0
I need to delete a record, however, in the WHERE clause one of the data has apostrophe. How can I verify this information, because it is obvious that will give error.
DELETE FROM IES WHERE IDENTIFICACAO ='456' AND ESTADO='SP' AND MUNICIPIO='SAO PAULO'
AND NOME_IES='UNISANT'ANNA' AND CURSO='PEDAGOGIA' AND TURNO='Noite' AND
MODALIDADE='Presencial' AND TELEFONE1='1121758000' AND ATENDENTE='2' AND STATUS=0;
Remembering that I tried using quotes and still it was not.
Could you help me?
Question: and the table primary key? With it you simply delete the record by Identifier, not all table columns.
– gmsantos
When you delete vc delete the entire record no matter which filter you used to choose which records will be deleted. Using PK is a good idea when you want to filter records efficiently. If you have a PK list you can use it like this: Where table.colunaPk in (valuePK1,valuePK2,...,valuePKn). Only +1 thing. You do not need to put numerical values between quotation marks.
– jean