Results 1 to 3 of 3

Thread: Help me with complex SQL Statemet

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2000
    Posts
    48

    Question

    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

  2. #2
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    617

    ...

    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

  3. #3
    Lively Member
    Join Date
    Nov 2000
    Location
    NC
    Posts
    66
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width