• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 222
  • Last Modified:

SQL Issue?

I am using this SQL: SELECT * from invoice where ListID = 'C4D0000-1163516830'.

It produces an empty result set.

See attached for table content. There is a record there with 'ListID' as specified.

Why can it NOT find this record?
sql-issue.jpg
0
Richard Korts
Asked:
Richard Korts
  • 2
1 Solution
 
Dan CraciunIT ConsultantCommented:
I suspect you have an extra space.

Verify if this works:
SELECT * from invoice where ListID LIKE '*C4D0000-1163516830*';

HTH,
Dan
0
 
Richard KortsAuthor Commented:
That did NOT work; however, I thought the % was the delimiter for "any characters" so I used:

SELECT * from invoice where ListID LIKE '%C4D0000-1163516830%'

and it worked.

Thanks
0
 
Dan CraciunIT ConsultantCommented:
Yup, sorry. On MySQL it's "%"
Too much Regex lately :)

Glad I could help!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now