Reputation: 25
For example if characterid = null I want the entire row removed: example of what I want removed:
but if characterid has a value then I want to keep the entire row: example of row I want to keep:
Obviously I can remove the rows myself manually but it would take way to long to do them all.
Upvotes: 0
Views: 6617
Reputation: 29
If your question is about PLSQL then I think you can use:
Select characterid
into //any variable//
from //tablename
where //condition
then you will check
if(anyvariable is null)
then
Delete from //tablename
where //condition
Upvotes: 0
Reputation: 4760
A delete query is pretty similar to a select query except that it says DELETE FROM
instead of SELECT * FROM
. You would run your delete like so:
DELETE FROM table WHERE characterid IS NULL
Before running the delete query, you can run this to make sure it matches the criteria of the data you want removed:
SELECT * FROM table WHERE characterid IS NULL
Also, always make sure you make a backup especially when a query like this can affect large sets of data.
Upvotes: 4