Slightly-OT: SQL Help

Peter Lindgren Peter.Lindgren at fdt.se
Tue Nov 9 08:16:31 CST 2004


Hej!

> On 11/8/04 3:24 PM, "Milan" <milan at mook.co.uk> wrote:
>> How can this be achieved? The NOT LIKE command cannot be used, as we
>> want to include instances where MARY and PRIMARY exist together
>> (RoseMARY, for example). The word PRIMARY needs to be completely
>> disregarded when the search is performed.

I don't know if Valentina supports this syntax, but you should be able to write something like SELECT name FROM yourtable WHERE name LIKE '%mary%' AND name<>'PRIMARY'

If you have many exceptions, put them in a table:
SELECT ... WHERE ... AND name NOT IN (SELECT exception FROM tablewithexceptions)

/Peter
-- 
Peter Lindgren, dataingenjör FDT System AB
http://www.fdt.se/           0920-24 33 00


More information about the Valentina mailing list