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 |
|
cruxmagi
Starting Member
38 Posts |
Posted - 2009-01-27 : 21:57:54
|
| I have resultset like thisMonday,January 19 2009-01-19 00:00:00.000 24 brushing true mas 2Monday,January 19 2009-01-19 00:00:00.000 30 Reading news paper 2Monday,January 19 2009-01-19 00:00:00.000 31 Reading news paper 2Monday,January 19 2009-01-19 00:00:00.000 32 Reading news paper 2Monday,January 19 2009-01-19 00:00:00.000 32 Reading news paper 2i want my o/p will be like thisMonday,January 19 2009-01-19 00:00:00.000 24 brushing true mas 2Monday,January 19 2009-01-19 00:00:00.000 30 Reading news paper 2Monday,January 19 2009-01-19 00:00:00.000 31 Reading news paper 2Monday,January 19 2009-01-19 00:00:00.000 32 Reading news paper 2when i use group by it throws an error,i d't want to select the duplicate taskId.Could you help me out |
|
|
AvanthaSiriwardana
Yak Posting Veteran
78 Posts |
Posted - 2009-01-27 : 22:02:34
|
| group by taskid and dateAvantha Siriwardana |
 |
|
|
cruxmagi
Starting Member
38 Posts |
Posted - 2009-01-27 : 22:06:06
|
| table structureDate TaskDate TaskId TaskName StatusMonday,January 19 2009-01-19 00:00:00.000 24 brushing true mas 2Monday,January 19 2009-01-19 00:00:00.000 30 Reading news paper 2Monday,January 19 2009-01-19 00:00:00.000 31 Reading news paper 2Monday,January 19 2009-01-19 00:00:00.000 32 Reading news paper 2Monday,January 19 2009-01-19 00:00:00.000 32 Reading news paper 2 |
 |
|
|
cruxmagi
Starting Member
38 Posts |
Posted - 2009-01-27 : 22:07:38
|
quote: Originally posted by AvanthaSiriwardana group by taskid and dateAvantha Siriwardana
it throws an error |
 |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2009-01-27 : 22:33:01
|
| [code]Select distinct [Date], TaskDate ,TaskId, TaskName ,Statusfrom table[/code] |
 |
|
|
cruxmagi
Starting Member
38 Posts |
Posted - 2009-01-27 : 22:40:56
|
quote: Originally posted by sodeep
Select distinct [Date], TaskDate ,TaskId, TaskName ,Statusfrom table
Thanks a lot.it worked out |
 |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2009-01-27 : 22:41:50
|
Welcome . |
 |
|
|
|
|
|
|
|