0

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...

3
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by akshit
0

SQL Syntax is

SELECT *
FROM TABLE
WHERE COLUMN1 = 'VALUE1' AND COLUMN2='' ....

It will be better if post the error text here

0

hi...

you can use code like this

SELECT * FROM `book` WHERE bname='Computer Fundamentals' and author='Shekhar G' and quantity='4' and category='Computer'

0

hey guys...

i figured out my mistake...

the code i was using was :

Select * from tablename where col1= value1 AND col2 ==value2

I guess the habit of using C caused the error. Anyways, tracing errors of this sort is extremely difficult, and the only way to avoid them is to have suffered bcoz of them once...

a big thx to all those who replied...

thx guys...

cheers...

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.