Data slection based on multiple conditions

hi frnds.

this is something which may seem foolish to ask, but i have been beating my head against the wall at the frustration of not being able to get over this...

anyways, what i want to do is to select some data from a single MySQl table, using a WHERE clause on multiple columns

eg. SELECT * from TABLENAME where COLUMN1 = VALUE1, COLUMN2 = VALUE2, COLUMN3 = VALUE3 ....

I have tried using (),AND as well as comma between the different conditions, but they all give an error.

please help...

cheers...

Replies

  • yudi
    yudi
    Re: data slection basd on multiple conditions

    try using OR operator coz as per my knowledge
    different conditions in where clause are seperated by OR operator......
  • esakiraja
    esakiraja
    Think this below eg will help u...

    Eg: select * from tablename where primarykey(column) = 'value'
    and column2 = 'value'
    and column3 = 'value'
  • Itanium
    Itanium
    select * from table
    where col1 = 'value1' and
    col2 = 'value2' and
    col3 = 'value3';

    this should be the query if all the columns are holding string data.
    If any column is holding numeric data, then you dont need to specify the value within quotes.

    Can you post your exact code for us to analyse ?

You are reading an archived discussion.

Related Posts

Hello thar! My name is Tyler, and I'm a 15 year old female who plans on majoring in electrical engineering at Louisiana Tech. I joined this forum to gain information...
Im currently doing my final year project which is the intelligent grounding system... But im not sure abt certain parts of my project, and i cant ask my advisor too...
Is June designated to be a wedding season? I had to attend a couple last week (which accounts for my hiatus from CE), and knew about half a dozen more....
Let's collect all our favorite one-liners in this thread Rule: Only one per post ! Mine is - 😁 "I don't believe in miracles, I rely on them" 😁
Hi everyone, I'm trying to use COM1 Port(DB9) in my desktop to glow some LED's. I tried with VBA but I could not make it. Anybody know how to control...