Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 224
  • 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
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.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

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