Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wildcard searches with zero length strings

Status
Not open for further replies.

rgordley

Programmer
Apr 30, 1999
63
US
SQL 7 will not properly perform this query<br>
SELECT * FROM TABLE WHERE FIELD LIKE 'A%'<br>
when the field contains zero length strings. In a table where only a few records actually contained values and the default value of the field was &quot;&quot; such a query returned the entire table. For various reasons I do not wish to have the default value be NULL. Is there anyway around this??
 
I haven't come accross this problem. You could try use the CONTAINS predicate:<br>
<br>
SELECT Column1 FROM Tab1<br>
WHERE CONTAINS(Column1, ' &quot;A&quot; ')<br>
<br>
note that this search unlike the LIKE is case sensitive<br>
<br>
Cal<br>
<br>
<br>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top