Hi Guys,
I've got a client with an anoyance in thier database, basicly they have a list of books in the database, and in the books table there are 3 fields for catagory, as a book can belong to 3 catagories at any one time.
What i want to do is search for a value that could exist in any field and then use that to output a list for each catagory.
Is there an 'OR' statement i can use after me WHERE to do this.
So i.e.
SELECT * FROM books WHERE catagory_1 = 1 OR catagory_2 = 1 OR catagory_3 = 1
or somthing to that effect? this way i can search for the same value in all three fields.
Thanks,
Rob
I've got a client with an anoyance in thier database, basicly they have a list of books in the database, and in the books table there are 3 fields for catagory, as a book can belong to 3 catagories at any one time.
What i want to do is search for a value that could exist in any field and then use that to output a list for each catagory.
Is there an 'OR' statement i can use after me WHERE to do this.
So i.e.
SELECT * FROM books WHERE catagory_1 = 1 OR catagory_2 = 1 OR catagory_3 = 1
or somthing to that effect? this way i can search for the same value in all three fields.
Thanks,
Rob