Posted by Joseph Connolly on 04/07/05 20:30
if i understand you question...
SELECT columns
FROM table
WHERE (condition #1) AND (condition #2);
You can add many conditions. There are many ways to do this. This one is
probably the most simple for only two conditions. Depending on your
needs you also may need to create a subquery.
SELECT colummns
FROM table
WHERE (condition#1) AND (
SELECT columns
FROM table
WHERE (condition#1a);
The second is more useful in joins or when joining a table to itself.
William Stokes wrote:
>Hello,
>
>This is not a php but sql question. My apologies but I don't know any good
>sql forums and I know that someone here might be able to answer.
>
>OK so the question is. How to make a SELECT query with WHERE definition that
>requires 2 conditions to be satisfied so that the row gets selected?
>
>MySQL manual says"where_definition consists of the keyword WHERE followed by
>an expression that indicates the condition or conditions that rows must
>satisfy to be selected"
>
>I just don't know how to write the query
>
>Thanks a lot
>-Will
>
>
>
>
>
Navigation:
[Reply to this message]
|