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
Richard KortsAsked:
Who is Participating?
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.