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 |
|
helixpoint
Constraint Violating Yak Guru
291 Posts |
Posted - 2009-04-02 : 14:38:36
|
| I am not sure you can give me an answer from just a query, but I have a script that brings back 265 records. How can I get a count from the query belowSELECT DISTINCT g.ID AS memberID, ea.Address, g.FirstName, g.LastName, ea.htmlYes, '0' AS AccountType, '0' AS GroupID, ea.Golfer AS ID, c.ContactName, c.ContactEmailFROM EmailAddresses AS ea INNER JOIN Golfers AS g ON ea.Golfer = g.ID INNER JOIN Sessions AS s ON s.Golfer = g.ID INNER JOIN Courses AS c ON s.Course = c.ID INNER JOIN CourseAllocation AS ca ON ca.Course = c.ID INNER JOIN CourseOrganization AS co ON ca.CourseOrganization = co.IDWHERE (c.Market = 6) AND (c.ID = 23) AND (co.ID = 10) AND (ea.IsOptedOut = 0)DaveHelixpoint Web Developmenthttp://www.helixpoint.com |
|
|
revdnrdy
Posting Yak Master
220 Posts |
Posted - 2009-04-02 : 15:06:27
|
quote: Originally posted by helixpoint I am not sure you can give me an answer from just a query, but I have a script that brings back 265 records.
Well you are correct. We do not know what it is you are trying to get a count of.You would need to be more specific. Are you trying to count all records or just a subset of them? r&r |
 |
|
|
helixpoint
Constraint Violating Yak Guru
291 Posts |
Posted - 2009-04-02 : 15:08:47
|
| I figured it out. thanxDaveHelixpoint Web Developmenthttp://www.helixpoint.com |
 |
|
|
yosiasz
Master Smack Fu Yak Hacker
1635 Posts |
Posted - 2009-04-02 : 15:08:57
|
| in the same query as another column? but you can use @@ROWCOUNT<><><><><><><><><><><><><><><><><><><><><><><><><>If you don't have the passion to help people, you have no passion |
 |
|
|
|
|
|