select * where a=1 if b=3

Hello,
How can I do a select like this:
Select all records, where (record a=1 if record b=3) or (record a=record b)
?

Regards,
Talthen
talthen.z-serwera.o2 [ Sa, 01 April 2006 17:43 ] [ ID #1256085 ]

Re: select * where a=1 if b=3

talthen.z-serwera.o2 [at] nospam.pl wrote:
> Hello,
> How can I do a select like this:
> Select all records, where (record a=1 if record b=3) or (record a=record b)
> ?

SELECT * FROM table WHERE (a=1 AND b=3) OR (a=b);


//Aho
Shion [ Sa, 01 April 2006 17:55 ] [ ID #1256086 ]

Re: select * where a=1 if b=3

"J.O. Aho" <user [at] example.net>

> SELECT * FROM table WHERE (a=1 AND b=3) OR (a=b);

Heh, of course it's it. I just spent too many hours on programming today.
Thanks.

Regards,
Talthen
talthen.z-serwera.o2 [ So, 02 April 2006 00:05 ] [ ID #1256087 ]

Re: select * where a=1 if b=3

Então vai dormir... simples...

--
Hélio,
Abraços
Helio Barbosa [ Di, 04 April 2006 17:42 ] [ ID #1259923 ]
PHP » alt.php.sql » select * where a=1 if b=3

Vorheriges Thema: LIKE and variable (beginner)
Nächstes Thema: PHPmyadmin, creating user details for a database....