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 |
|
sr_aneesh
Starting Member
17 Posts |
Posted - 2004-11-14 : 01:59:12
|
| I have the following table with name, Age and StatusName Age StatusJacob 25 MumbTom 28 MumbLeo 23 OiasMary 21 jubTaylor 23 hutJacob 25 byaJacob 23 Fretaylor 23 TreTaylor 23 WerLeo 21 ErqJacob 25 Trewhat query should be written to retrieve records with same name and age with number of records...that is the result should be as followsName Age CountJacob 25 3jacob 23 1Tom 28 1Leo 23 1Leo 21 1mary 21 1taylor 23 2and so on....i would highly appreciate if some one could suggest me website for learning SQL Queries from basic to advancedThanx a lot in advance.... |
|
|
Kristen
Test
22859 Posts |
Posted - 2004-11-14 : 03:26:42
|
| SELECT Name, Age, COUNT(*) FROM MyTable GROUP BY Name, Age ORDER BY Name, AgeWWW.W3SCHOOLS.COM may have some useful reading.Kristen |
 |
|
|
|
|
|