Results 1 to 2 of 2

Thread: Syntx for Select Statement

  1. #1
    Join Date
    Jul 2010
    Thanked 0 Times in 0 Posts

    Default Syntx for Select Statement

    Good day!

    I want to know if what is the correct sysntax for Selecting multiple data in one column.

    I have a table trace and i have column name, id\
    my list name are: name1, name1total, name2,name2total,name3,name4, and name5, but i wamnt to select only is the name 1,name3,name4, and name5
    I have a table trans and it has id.

    I try this code:

    SELECT FROM trace t, trans c WHERE = 'name1' || 'name 3' || 'name4' || 'name5' AND;
    In that code all the name was selected eventhough I did not select the name1total,name2,name2total.

    Thank you

  2. #2
    Join Date
    May 2009
    Thanked 3 Times in 3 Posts


    Select FROM trace t, trans c WHERE = 'name1' OR = 'name 3' OR = 'name4' OR = 'name5' AND =;

    If it doesn't work, try to group all the ORs with the use of parenthesis, because I think, the AND operator is executed first before the OR, so when = is TRUE, then it will not execute the ORs statement.. I'm not sure though.. It's just a tip....

    or you can do it this way:

    Select FROM trace t, trans c WHERE IN( 'name1','name 3', 'name4','name5') AND =;

    Note: I haven't tried this code... I'm just experimenting... But I'm not joking around...

  3. The Following User Says Thank You to heavensgate15 For This Useful Post:

    rhodarose (12-14-2010)


Posting Permissions

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