Hi
Trying to retrive a report from the DataBase using left join on two tables. To get the count of resultant table, I'm using count. But the output shows error. If I comment count statement then the query executes successfully.
I feel there is some error in the syntax of the count that I'm using.
Please give me the exact syntax for both count as well as inner join.
Thanks in advance.
Software/Hardware used:
MS SQL 2005
ASKED:
July 27, 2010 11:13 AM
UPDATED:
July 27, 2010 4:04 PM
The general syntax is:
SELECT <some_columns>, COUNT(*)
FROM table1 t1 JOIN table2 t2
ON t1.columnX = t2.columnX
WHERE …
GROUP BY <some_columns>
Why don’t you post your query, so we can tell you where your error is ?