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 |
|
engcanada
Starting Member
39 Posts |
Posted - 2012-06-01 : 11:32:09
|
| Can I use LEFT OUTER JOINfor the follwoing 2 statements? I tried it with no success. If Not, can anyone suggest an alternative.select * from table1select count(idreply) as total from table2they have idjob in common.Regards |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-06-01 : 11:33:50
|
| [code]select t1.*,t2.total from table1 t1left join (select idjob,count(idreply) as total from table2 group by idjob)t2on t2.idjob = t1.idjob[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|