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 |
|
rammohan
Posting Yak Master
212 Posts |
Posted - 2009-11-20 : 04:33:13
|
| hi i have a table data like this Name Subject Marks ResultSteve Maths 50 PSteve Scince 50 PSteve Social 35 FJohn Maths 50 PJohn Scince 50 PJohn Social 35 Fnow i need to write a query to display result like this: Name Subject Marks ResultSteve Maths 50 P Scince 50 P Social 35 FJohn Maths 50 P Scince 50 P Social 35 Fis it possible to write a query to get result like this?One can never consent to creep,when one feels an impulse to soarRAMMOHAN |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2009-11-20 : 04:38:22
|
you should do this in your front end application not in TSQL KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-11-20 : 05:03:35
|
quote: Originally posted by rammohan hi i have a table data like this Name Subject Marks ResultSteve Maths 50 PSteve Scince 50 PSteve Social 35 FJohn Maths 50 PJohn Scince 50 PJohn Social 35 Fnow i need to write a query to display result like this: Name Subject Marks ResultSteve Maths 50 P Scince 50 P Social 35 FJohn Maths 50 P Scince 50 P Social 35 Fis it possible to write a query to get result like this?One can never consent to creep,when one feels an impulse to soarRAMMOHAN
Put the code tags [code ]your code[/code ] (remove space)This is called "suppress if duplicated"Where do you want to show data?MadhivananFailing to plan is Planning to fail |
 |
|
|
rammohan
Posting Yak Master
212 Posts |
Posted - 2009-11-20 : 05:21:47
|
| i am planning to fill this query result to dataset in .net, so i want to get data like this from query One can never consent to creep,when one feels an impulse to soarRAMMOHAN |
 |
|
|
kbhere
Yak Posting Veteran
58 Posts |
Posted - 2009-11-20 : 05:56:53
|
| Using cursor we can do this.. If your application can use cursor, this task can be easily done..Balaji.K |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-11-20 : 07:28:13
|
quote: Originally posted by rammohan i am planning to fill this query result to dataset in .net, so i want to get data like this from query One can never consent to creep,when one feels an impulse to soarRAMMOHAN
Do you want to show them in grid?MadhivananFailing to plan is Planning to fail |
 |
|
|
rammohan
Posting Yak Master
212 Posts |
Posted - 2009-11-20 : 08:22:07
|
| hi madhvinan,i need to export this dataset to excel. it is a console applicationOne can never consent to creep,when one feels an impulse to soarRAMMOHAN |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-11-30 : 04:56:56
|
quote: Originally posted by rammohan hi madhvinan,i need to export this dataset to excel. it is a console applicationOne can never consent to creep,when one feels an impulse to soarRAMMOHAN
When you export data to EXCEL from grid, suppress the duplicated valuesMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|