I want to merge these two Select queries into single query. How can i do this?
SELECT link_id, COUNT(*) FROM Loc GROUP BY link_id
SELECT Slink.[xlink:Show],Loc.[xlink:show],
Slink.[xlink:actuate],Loc.[xlink:actuate] ,
href, Sem.SemRoleDescrip
FROM Sem JOIN Loc ON
Sem.SemRoleId = Loc.SemRoleId
JOIN Slink ON Slink.link_id = Loc.link_id
One solution would be to
COUNTstatement as a subquery(LEFT) JOINthis subselect with theSLinktableLinkCountto the list of selected values.SQL Statement
You might want to read up on Subqueries in the reference manual