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 |
kond.mohan
Posting Yak Master
213 Posts |
Posted - 2012-05-30 : 05:36:34
|
i am executing sql query in ssms 2008 based on typeempno,name,salarycase when type=A then name end type1,case when type=D then name end type2,locationi got output like this empno name sal type1 type2 date1 dfl 100 ---- flsdf 19-08-20121 dfl 100 ---- dfggh 19-08-20121 dfl 100 k punct ------ 19-08-20121 dfl 100 k newyear ----- 19-08-2012my expected out put is empno name sal type1 type2 date1 dfl 100 k punct flsdf 19-08-20121 dfl 100 k newyear dfggh 19-08-2012 |
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2012-05-30 : 07:29:36
|
No you don't. query has locatio, result has date - not possible.maybe select empno,name,salarymax(case when type=A then name end) type1,max(case when type=D then name end) type2,locationfrom tblgroup by empno,name sal,location==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
vinu.vijayan
Posting Yak Master
227 Posts |
Posted - 2012-05-30 : 07:38:51
|
Please post some sample data to work with.N 28° 33' 11.93148"E 77° 14' 33.66384" |
 |
|
|
|
|