Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
csphard
Posting Yak Master
113 Posts |
Posted - 2005-06-05 : 18:51:55
|
| this one is goodSELECT srv_currentChildcare, Count(*) as mycount, CAST(Count(*) as float) * CAST( 100 as float) / Cast( ( SELECT Count(*) FROM college_survey where srv_college = 'Academy of Chinese Culture and Health Sciences ') as float) as percentage FROM college_survey where srv_college = 'Academy of Chinese Culture and Health Sciences 'GROUP BY srv_currentChildcarethis one is goodSELECT srv_campusChildcare, Count(*) as mycount, CAST(Count(*) as float) * CAST( 100 as float) / Cast( ( SELECT Count(*) FROM college_survey where srv_college = 'Academy of Chinese Culture and Health Sciences ') as float) as percentage FROM college_survey where srv_college = 'Academy of Chinese Culture and Health Sciences 'GROUP BY srv_campusChildcarethis one is goodSELECT srv_barriers, Count(*) as mycount, CAST(Count(*) as float) * CAST( 100 as float) / Cast( ( SELECT Count(*) FROM college_survey where srv_college = 'Academy of Chinese Culture and Health Sciences ') as float) as percentage FROM college_survey where srv_college = 'Academy of Chinese Culture and Health Sciences 'GROUP BY srv_barriersit errors hereSELECT srv_maritalStatus, Count(*) as mycount, CAST(Count(*) as float) * CAST( 100 as float) / Cast( ( SELECT Count(*) FROM college_survey where srv_college = 'Academy of Chinese Culture and Health Sciences ') as float) as percentage FROM college_survey where srv_college = 'Academy of Chinese Culture and Health Sciences 'GROUP BY srv_maritalStatustable usedCREATE TABLE [college_survey] ( [srv_id] [int] IDENTITY (1, 1) NOT NULL , [srv_college] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL , [srv_currentChildcare] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL , [srv_campusChildcare] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL , [srv_barriers] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL , [srv_barriersOther] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL , [srv_maritalStatus] [text] COLLATE Chinese_PRC_CI_AS NULL , [srv_ageGroup] [text] COLLATE Chinese_PRC_CI_AS NULL , [srv_gender] [text] COLLATE Chinese_PRC_CI_AS NULL , [srv_ethnicity] [text] COLLATE Chinese_PRC_CI_AS NULL , [srv_ethnicityOther] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL , [srv_highestEd] [text] COLLATE Chinese_PRC_CI_AS NULL , [srv_monthlyGross] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL , [srv_careNeededwhen] [text] COLLATE Chinese_PRC_CI_AS NULL , [srv_careNeededwhenOther] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL , [srv_currentLivingArrangements] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL , [srv_currentLivingArrangementsOther] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL , [srv_numChildren] [char] (10) COLLATE Chinese_PRC_CI_AS NULL , [srv_numChildren02] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL , [srv_numChildren25] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL , [srv_numChildren56] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL , [srv_numChildren6] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL , [srv_homeComputer] [text] COLLATE Chinese_PRC_CI_AS NULL , [srv_inputDate] [datetime] NOT NULL CONSTRAINT [DF_college_survey_srv_inputDate] DEFAULT (getdate())) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]GO |
|
|
robvolk
Most Valuable Yak
15732 Posts |
|
|
|
|
|
|
|