SDEWIS
asked on
conditional SQL query to blank out a field
Hi guys
I'm not an SQL query guru by any means, so I'm asking here!
I have an SQL based accounting application.
In my stock records, some of the product records begin with 94xxx.
I field in the same table has been filled in incorrectly for certain 94xxx records, and needs to be blanked out - i.e.be empty.
Trouble is, there's around 4-500 records to go through, something I don't fancy doing by hand!
What would be an SQL query which would search all records beginning with 94 (say, field 1), and delete the contents of field 2 if it contains anything?
thanks in advance
Sean
I'm not an SQL query guru by any means, so I'm asking here!
I have an SQL based accounting application.
In my stock records, some of the product records begin with 94xxx.
I field in the same table has been filled in incorrectly for certain 94xxx records, and needs to be blanked out - i.e.be empty.
Trouble is, there's around 4-500 records to go through, something I don't fancy doing by hand!
What would be an SQL query which would search all records beginning with 94 (say, field 1), and delete the contents of field 2 if it contains anything?
thanks in advance
Sean
ASKER
thanks jd, that selects the fields, I'm guessing.
Question is, how do I make field 2 in that selection empty/blank?
Question is, how do I make field 2 in that selection empty/blank?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That hit the spot more full on! Thanks Paul - don't worry, I'll be trying it out on my test/wrecker database first!
SELECT *
FROM TableA
WHERE field1 LIKE '94%'