Discussion: Select AND IF
Afficher un message
Vieux 03/10/2007, 16h05   #3
Rik Wasmus
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Select AND IF

On Wed, 03 Oct 2007 16:18:08 +0200, turnitup <same@same> wrote:

> I want to include an AND clause, but only if a certain criteria is met..
> There are other AND clauses. Pseudo code below
>
> SELECT * from tbl where foo = 1 AND bar = 1 AND IF ( (asas != 1)asas >
> 2 )
>
> Is this possible?


SELECT * from tbl
WHERE foo = 1
AND bar = 1
AND (asas = 1
OR asas > 2)
--
Rik Wasmus
  Réponse avec citation
 
Page generated in 0,06027 seconds with 9 queries