PDA

Click to See Complete Forum and Search --> : Help me with complex SQL Statemet


msuryadarma
Nov 10th, 2000, 12:08 PM
Hi everyone,

I have this table:

TYPE ID Column3 Column4
-----------------------------
Data 001 Smith NY
Data 002 Lisa PA
Educ 001 Columbia BS
Educ 002 Harvard MBA

All right. Now if the user selects "S" he/she will get:
001 Smith Columbia BS

If the user selects "L" he/she will get:
002 Lisa Harvard MBA

I am a newbie at SQL, so this might be simple, but I am clueless about this. Can't exactly do JOIN because they're all in one table. But I don't know.

Thank you so much.

Martin

Lafor
Nov 10th, 2000, 12:14 PM
Did not read with great attention the msg

but seeing the final question

u can do a join on a single table

select X.field1, X.field2, Y.field3 .....etc
from table1 X, table1 Y
where X.column = Y.column

KMcKenzie
Nov 10th, 2000, 04:21 PM
I'm notsure that I understand the question. Are you looking for a SQL statement where you can provide the S and find names that start with that letter or are you saying that you already have that working and are trying to accomplish something else? Why do you think that you need to join the table on itself? I'm sorry I woul dlove to help but I just don't understand and I think that the answer is probably a fairly simple one.