Tuesday, March 27, 2012

Distinct?

Hi,
Select Distinct(SomeTable.EmployeeID), EmpTable.EmployeeName from
SomeTable,EmpTable Where EmpTable.ID = * Distinct(SomeTable.EmployeeID) *
'
How to do that? I need join just the distinct Id from a table with other
table...
Is it possible to be done ?You could do this:
Select Distinct(SomeTable.EmployeeID), EmpTable.EmployeeName from
(select distinct EmployeeID from SomeTable) A join EmpTable B on EmpTable.ID
= A.EmployeeID
Jason Massie
www: http://statisticsio.com
rss: http://feeds.feedburner.com/statisticsio
"Paulo Roberto" <paulo.roberto@.edt.com.br> wrote in message
news:eIucQTDRIHA.5400@.TK2MSFTNGP04.phx.gbl...
> Hi,
> Select Distinct(SomeTable.EmployeeID), EmpTable.EmployeeName from
> SomeTable,EmpTable Where EmpTable.ID = * Distinct(SomeTable.EmployeeID) *
> '
> How to do that? I need join just the distinct Id from a table with other
> table...
> Is it possible to be done ?
>|||SELECT Distinct SomeTable.EmployeeID ,EmpTable.EmployeeName from
SomeTable
INNER JOIN EmpTable ON SomeTable.EmployeeID = EmpTable.ID
Jack Vamvas
___________________________________
Search IT jobs from multiple sources- http://www.ITjobfeed.com
"Paulo Roberto" <paulo.roberto@.edt.com.br> wrote in message
news:eIucQTDRIHA.5400@.TK2MSFTNGP04.phx.gbl...
> Hi,
> Select Distinct(SomeTable.EmployeeID), EmpTable.EmployeeName from
> SomeTable,EmpTable Where EmpTable.ID = * Distinct(SomeTable.EmployeeID) *
> '
> How to do that? I need join just the distinct Id from a table with other
> table...
> Is it possible to be done ?
>sql

No comments:

Post a Comment