Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
I am trying to group various document types into groups. For example if the doc type is ST, YT, and DP, I would like this to belong to a group known as 'failed'. If the doc type is NM, NF, LK, I would like this to belong to another group known as 'passed'. I am not sure how to do this.
khtan
In (Som, Ni, Yak)
17689 Posts
Posted - 2006-09-18 : 10:32:03
something like this
select case when doc_type in ('ST', 'YT', 'DP') then 'failed' when doc_type in ('NM', 'NF', 'LK') then 'passed' end, . . . from tablegroup by case when doc_type in ('ST', 'YT', 'DP') then 'failed' when doc_type in ('NM', 'NF', 'LK') then 'passed' end
KH
SwePeso
Patron Saint of Lost Yaks
30421 Posts
Posted - 2006-09-18 : 11:28:11
else 'unknown' ?Peter LarssonHelsingborg, Sweden
madhivanan
Premature Yak Congratulator
22864 Posts
Posted - 2006-09-18 : 11:30:43
quote:Originally posted by Peso else 'unknown' ?Peter LarssonHelsingborg, Sweden
I think in Exams only Pass or Fail and no Unknown MadhivananFailing to plan is Planning to fail