March 18, 2003 at 10:15 am
On SS7.0, I have a table called persons with FirstName varchar(25) and LastName varchar(25).
I need to retrieve all the records in that table with the last name O'Malley. How do I do that? Is it:
SELECT * FROM PERSONS WHERE LASTNAME = 'O''Malley';
Just want to confirm. I don't have SS7.0 on my machine but I cannot verify this.
Thanks in advance,
Billy
March 18, 2003 at 10:37 am
Try this:
DECLARE @Lastname VARCHAR(25)
SELECT @LastName = 'O'+''''+'Malley'
SELECT * FROM PERSONS WHERE LASTNAME = @LastName
March 18, 2003 at 10:50 am
quote:
SELECT * FROM PERSONS WHERE LASTNAME = 'O''Malley';
Correct.
--
Chris Hedgate @ Apptus Technologies (http://www.apptus.se)
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply