SQL help

Jan 03, 2007 3 Replies

I want to make sub description 3 say NOT SALE where it Does not contain S



My SQL knowledge is basic. I can do: UPDATE item



set subdescription3 = 'NOT SALE'



where subdescription3 = ''



Which will make it correct for blank items, but I don't know how to do any kind of Not command?



Please help.



Chris


See if this gets you the rows you are looking for:

Select itemlookupcode, description, subdescription3 from item where subdescription3 NOT LIKE '%S%'

% is the wild card for SQL - kind of like * in most other contexts.

Glenn Adams Tiber Creek C> I want to make sub description 3 say NOT SALE where it Does not contain S >

Here are a couple of SQL tutorial & reference sites:

formatting link
formatting link
formatting link
You can use NOT in an SQL statement.

If you have doubts about yoru query, use SELECT instead of UPDATE. Once the SELECT query returns the right results, change it to update and away you go.

Backup your database!

Tom

Use the operator instead of To see what records would be affected, first do:

SELECT * from item where subdescription3 ''

UPDATE item set subdescription3 = 'NOT SALE' where subdescription3 ''

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required