SuperJinx
asked on
How to delete records from a table in pure SQL?
I have been playing around with the insert statement in my SQL, i looked at my table and noticed that i have got 8 records for one person and 8 records for another person both of whom i used the insert statement for numerous times, obviously i only want one record for each person.
I tried to use logic, and tried DELETE * FROM Person WHERE FirstName = 'Jack Lumsdon'
&
DELETE * FROM Person WHERE FirstName IS =('Jack Lumsdon')
But to no avail. I get a red squiggly line underneath the * and the error message Incorrect syntax '*'.
Any ideas of how i can get my table to delete these and bring me back down to just one record for each person.
Thanks!
I tried to use logic, and tried DELETE * FROM Person WHERE FirstName = 'Jack Lumsdon'
&
DELETE * FROM Person WHERE FirstName IS =('Jack Lumsdon')
But to no avail. I get a red squiggly line underneath the * and the error message Incorrect syntax '*'.
Any ideas of how i can get my table to delete these and bring me back down to just one record for each person.
Thanks!
try DELETE FROM Person WHERE FirstName = 'Jack Lumsdon'
ASKER
No joy! in the message's also says 0 records affected
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Your example has a first and a last name in the quotes. Is the table splitting name up into two columns perhaps and you need to specifiy FirstName = 'Jack' AND LastName = 'Lumsdon' in your WHERE clause?
ASKER
Nice one dude, that sorted it out for me!
Cheers!
Cheers!
to display the table structure execute a describe statement on the person table
describe person
describe person