RE: help with a sql

RE: help with a sql

 

  

Would this do it?

Select tableb.employeeId, count(*)
From tableA a,
tableB b
Where a.employeeId = b.employeeId
Group by b.employeeId
Having count(*) > 1

-----Original Message-----
From: Pillai Sreelatha
[mailto:mssqldba-ezmlmshield-x91371212.[Email address protected]
Sent: Friday, February 29, 2008 8:50 AM
To: LazyDBA Discussion
Subject: help with a sql

If i have tableA and tableB both of which are linked with employeeid column
how do i check to see for 1 record of an employee in tableaA there are
multiple records in tableB? Any help will be greatly appreciated. TIA For
reln TableA.employeeid = TableB.employeeid



This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity to
which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified that
any dissemination, distribution or copying of this e-mail is prohibited. If
you have received this e-mail in error, please notify the sender by replying
to this message and delete this e-mail immediately.



---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY To post a dba
job: http://jobs.lazydba.com To subscribe : http://www.LazyDBA.com To
unsubscribe: http://www.lazydba.com/unsubscribe.html



MS Sql Server LazyDBA home page