Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Counts Issue

Status
Not open for further replies.
Apr 21, 2011
1
US
Hi,

I have a table with columns
colA colB
x x
x y
x z
y x
y y
y z
z x
z y
z z

I want to link values in colA with colB just once. My result should have something like this
x x
x y
x z
Can someone please help me with this.

Thanks!
 
You have hopefully figured this out by now, but if not....try this
[tt]Select
colA
, colB
From
(
Select
colA
From
myTable
Group By
colA
) A
Inner Join
(
Select
colB
From
myTable
Group By
colB
) B
On
colA = colB
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top