SQL Question

chewy

SuperNintendo Chalmers
Local time
Today, 16:57
Joined
Mar 8, 2002
Messages
581
What is the difference between

SELECT * FROM Persons WHERE LastName = 'Majewski';

and

SELECT * FROM Persons WHERE LastName = "Majewski";

When will you run into trouble switching the single and double quotes? Or will I not run into trouble
 
chewy said:
When will you run into trouble switching the single and double quotes?

When the name might be O'Donnelly etc.

Then you'd have:

SELECT * FROM Persons WHERE LastName = 'O'Donnelly';

The 'O' would be a string in its own right - the Donnelly' part would cause an error.
 
So should that be all wrapped in " " ?
 
The latter SQL statement you posted is the better one.
 
cool Thanks for the Info!
 

Users who are viewing this thread

Back
Top Bottom