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

Rik Wasmus wrote:
> 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


THank you both, that may have just done the trick.
  Réponse avec citation
 
Page generated in 0,05308 seconds with 9 queries