Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

sql Like statement

New Here ,
May 28, 2008 May 28, 2008
how can i get all records starting with % ?
TOPICS
Database access
473
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 28, 2008 May 28, 2008
Does your db have string functions?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 09, 2008 Jun 09, 2008
This works for SQL server:
select * from tablename where Left(myfield, 1) = '%'
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Jun 09, 2008 Jun 09, 2008
LATEST
Something that I found here ( SQL Tutorial) might help:

The optional ESCAPE sub-clause specifies an escape character for the pattern, allowing the pattern to use '%' and '_' (and the escape character) for matching. The ESCAPE value must be a single character string. In the pattern, the ESCAPE character precedes any character to be escaped.
For example, to match a string ending with '%', use:

x LIKE '%/%' ESCAPE '/'


..or here Using SQL Escape Sequences

... or here How to escape a wildcard in an SQL order with ORACLE.

Phil
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources