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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL SERVER 2000, inner join

Status
Not open for further replies.

pssheba

Programmer
Oct 22, 2004
87
IL
Hi !
I have a table with 2 columns: cola, colb.
In cola i have alphabetic characters: "a", "b", "c"...
and in colb i have digits: "1","2","3","4"...
I'd like to display all the digits in colb that match a letter in cola : a 1, a 3, a 9.... one row per letter. Means, first row in my select query will yield the letter a plus 1, 3, 9 following it (a letter can have at most 3 equivalent digits).
My code is:
Code:
select a.letter, b.digit1, b.digit2, b.digit3
from
mytable as a inner join mytable as b
on
a.letter=b.letter
The code is wrong of course and i wish someone could show me how to do it right !
Thanks a lot !
 
Have a look at this FAQ's: faq183-6466

I think that will get you going.

Hope it helps,

Alex

Ignorance of certain subjects is a great part of wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top