Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

SQL Issue?

Posted on 2014-03-03
3
Medium Priority
?
219 Views
Last Modified: 2014-03-03
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
Comment
Question by:Richard Korts
  • 2
3 Comments
 
LVL 35

Accepted Solution

by:
Dan Craciun earned 2000 total points
ID: 39901523
I suspect you have an extra space.

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

HTH,
Dan
0
 

Author Comment

by:Richard Korts
ID: 39901666
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
 
LVL 35

Expert Comment

by:Dan Craciun
ID: 39901671
Yup, sorry. On MySQL it's "%"
Too much Regex lately :)

Glad I could help!
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Containers like Docker and Rocket are getting more popular every day. In my conversations with customers, they consistently ask what containers are and how they can use them in their environment. If you’re as curious as most people, read on. . .
In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month10 days, 19 hours left to enroll

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question