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 |
|
msv
Starting Member
9 Posts |
Posted - 2009-05-25 : 10:40:53
|
| I have 2 tables... I need to display the SRID,SRNUM and also the number of records associated to the SRID (like the number of columns returned when you enter an SRID)SELECT a.SRID as ID, b.SR_NUM as Number,count (*) as Total FROM ACT a with (nolock) INNER JOIN SERV b (nolock) on a.SRID = b.SR_IDNeed some help... everytime i run this with the Count it throws me an error... Need some help here |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2009-05-25 : 10:42:38
|
| SELECT a.SRID as ID, b.SR_NUM as Number,count (*) as Total FROM ACT a with (nolock)INNER JOIN SERV b (nolock) on a.SRID = b.SR_IDgroup by a.SRID , b.SR_NUM==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-05-25 : 10:43:46
|
SELECT a.SRID as ID, b.SR_NUM as Number,count (*) as Total FROM ACT a with (nolock)INNER JOIN SERV b (nolock) on a.SRID = b.SR_IDGROUP BY a.SRID, b.SR_NUM E 12°55'05.63"N 56°04'39.26" |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-05-25 : 10:44:03
|
 E 12°55'05.63"N 56°04'39.26" |
 |
|
|
msv
Starting Member
9 Posts |
Posted - 2009-05-25 : 11:33:30
|
| Thank you so much!! |
 |
|
|
|
|
|