Click here to Skip to main content
15,891,828 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi friends
my language is Persian (IRANIAN)
i write this query in sql server 2088 :
select * from Table1 where Name Like '%unique-char%'

but result is 0 rows
please guide me for unique characters
Posted
Updated 7-Sep-11 22:40pm
v2
Comments
Prerak Patel 8-Sep-11 4:41am    
Which unique characters?
Philippe Mori 8-Sep-11 20:40pm    
Search and ordering depend on the specified character set in the database and also if comparison are case-sensitive or not.

First of all you need to understand the purpose of Like keyword in SQL.
LIKE keyword helps you apply wildcard search in SQL/Oracle etc. e.g. If you want to find all the students for which name starts with P then query would be :
SELECT * FROM Students WHERE Name LIKE 'P%'


You can find a lots of examples at MSDN Like Keyword[^] also at Tech on the net[^]

Coming back to your question :
From your query it is evident that you want to list all the rows for which Name contains the string "unique-char". The reason that you are getting 0 rows, is there may be no row for which name contains the string "unique-char". Try to narrow the search. e.g
select * from Table1 where Name Like 'u%'
or
select * from Table1 where Name Like '%char%'
etc.

Hope this helps you.
All the best.
 
Share this answer
 
v2
i think your query is correct.

any do like this

select * from Table where field like '%char%'

i hope this is useful to you
 
Share this answer
 
Comments
vahid_erad 8-Sep-11 4:39am    
my language is Persian , for Persian language this query not work

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