Click here to Skip to main content
15,897,718 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
suppose i have table like.
user{user_id,user_name}
user_info{user_id,city,address}
marks{user_id,score}
now i want to find the total score and user name of surat city so what should be the quary is????
Posted
Comments
[no name] 5-Jul-12 12:01pm    
The same way the you were told how to find the number of employees in your previous question? Taking an exam? Are you in an interview? Taking a test for an interview?
AmitGajjar 5-Jul-12 12:09pm    
homework ???? do it yourself.
pandya purvang 5-Jul-12 12:30pm    
i cant find the answer so i m putting this on codeproject i m very new to sqlserver and i want to learn new thing quickly so still i hope that any one will be solve out it............
[no name] 5-Jul-12 12:38pm    
You are not going to learn anything by doing this. You learn by doing research, reading, taking classes and actually doing something. You are not going to get a sufficient grasp of SQL or SQL Server by spamming message boards.
Sergey Alexandrovich Kryukov 5-Jul-12 12:45pm    
Right!
--SA

1 solution

You need to use a combination of a JOIN[^] and GROUP BY[^] clause. You can then aggregate by using the SUM() function[^].

Try on your own based on these links / examples and post any issues if you run into them.
 
Share this answer
 
Comments
pandya purvang 5-Jul-12 12:29pm    
i cant find the answer so i m putting this on codeproject i m very new to sqlserver and i want to learn new thing quickly so still i hope that any one will be solve out it............

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900