Click here to Skip to main content
15,896,154 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Suppose my data value is store in table1
The data value is 'D0001' in varchar data type

How can i pick up by query of that type of data value(i.e. 'D0001') with quotation mark????
Please help me.....
Posted

Like this:

SQL
SELECT * FROM MyTable WHERE MyColumn = '''D0001'''


The idea is to use double quotes.
 
Share this answer
 
Comments
Maciej Los 7-Jun-12 4:05am    
Good answer, my 5!
Manas Bhardwaj 7-Jun-12 4:07am    
Thanks!
hi,

SELECT * FROM MyTable WHERE MyColumn like '%D0001%'


when using the field with varchar as an datatype.

u better use with like statement.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900