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 |
|
hameedf
Starting Member
27 Posts |
Posted - 2012-06-29 : 02:50:57
|
| Hello Experts !I have a query in which i sum the data and i dont want group the other column which is character suppose Select sum(fee),student_name from studentwhere ...Group by sum(fee)order by student_nameIam doing like that i dont want to group by student name ?ThankshamedfHameed |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2012-06-29 : 03:32:37
|
[code]Select sum(fee),student_name from studentwhere ...Group by sum(fee) student_nameorder by student_name[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
hameedf
Starting Member
27 Posts |
Posted - 2012-06-29 : 05:22:35
|
| Thank you Khtan,if i am joing two table and column name table1.column_1, table2.columnSelect sum(table1.fee),table1.student_name as st1,table2.student_name as st2 from table1,table2where ...Group by table1.student_nameorder by student_nameI dont want to group by table2.student_name so what should i do if i group by table2.student_name my results not correct?ThanksHamedfHameed |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2012-06-29 : 06:15:14
|
how do you join these 2 table ? on student_name ? KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
hameedf
Starting Member
27 Posts |
Posted - 2012-06-29 : 08:08:36
|
| Select sum(table1.fee),table1.student_name as st1,table2.student_name as st2 from table1,table2where table1.ITEM_ID=table2.ITEM_IDGroup by table1.student_nameorder by student_nameHameed |
 |
|
|
|
|
|
|
|