Thread: how to have 2 select creteria on one column?

how to have 2 select creteria on one column?

From
Michael Hoeller
Date:
Hello, 

I would like to select every row which has got in the column CODE a "k" 
but I want to exclude every "kV" -- may be it is due to the fact that 
it is Saturday and I work too long I don't get it.. I tried a 
subselect, union but I struggle with the two select creteria on one 
column.

Can some one help me -- hope this is not a too stupid question. Normally 
google is my friend but also there I did not find a solution.

Thanks a lot 
Michael


Re: how to have 2 select creteria on one column?

From
Richard Huxton
Date:
Michael Hoeller wrote:
> Hello, 
> 
> I would like to select every row which has got in the column CODE a "k" 
> but I want to exclude every "kV" -- may be it is due to the fact that 
> it is Saturday and I work too long I don't get it.. I tried a 
> subselect, union but I struggle with the two select creteria on one 
> column.

SELECT * FROM my_table
WHERE code = 'k'
AND code <> 'kV'
;

HTH
--   Richard Huxton  Archonet Ltd


Re: how to have 2 select creteria on one column?

From
Bruno Wolff III
Date:
On Sat, Sep 10, 2005 at 17:45:50 +0200, Michael Hoeller <MichaelHoeller@t-online.de> wrote:
> Hello, 
> 
> I would like to select every row which has got in the column CODE a "k" 
> but I want to exclude every "kV" -- may be it is due to the fact that 
> it is Saturday and I work too long I don't get it.. I tried a 
> subselect, union but I struggle with the two select creteria on one 
> column.

Your description isn't as precise as would be nice. But from what I can figure
you want:
code ~ '^k[^V]'