|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
1200+ fellow developers rate and compare features of the top IDEs, like Visual Studio, Eclipse, RAD, Delphi and others, across 13 categories. Enjoy this FREE Download of the IDE User Satisfaction Study by Evans Data Corporation. Download Now!
|
|
#1
|
|||
|
|||
|
LIKE Clause in query
Question..
In a MSSQL SELECT Statement e.g SELECT t1.fname, t1.lname, t2.district_name, t2.district_number FROM t1 AS table1, t2 AS table2 WHERE t2.district_name LIKE 'S%' i have these values in the table table1 fname lname mike jackson roy mires table2 district_name district_number South 123 Daggerty 7845 duffel 7224 rubble 7545 Now the query is dynamic (the letter is that the like clause is run against) When the letter D is searched for i get the 2 colums duffel, daggerty BUT when S is searched against I get nothing.. I am confused as to why, It doesn't seem to be case sensitive, as the 2 colums duffel and Daggerty 1 is d is in lowercase and the other is in uppercase. andive tries both lowercase s and uppercase S and still got nothing. Is tehre a better way to use the LIKE clause? Ive looked and looked for documentation about the LIKE clause but I cannot find anything Am i doing something wrong? any help would be greatly appreciated |
|
#2
|
||||
|
||||
|
interesting query, but there are a couple things wrong
first, it's a cross join on purpose? there is no join condition second, you're using the aliases incorrectly but i assume that these are merely errors of transcription, resulting from you changing tables in the query in order to post it here other than that, it's fine the problem must be your script logic that displays the results |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > LIKE Clause in query |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|