Plummer
Plummer

Reputation: 6698

mySQL 'SELECT' limit to variable string

I'm trying to run the following command:

SELECT * FROM my_table WHERE thecolum = thevar;

My actual command is:

SELECT * FROM jos_mls WHERE mstlistbrd = 3675E4340E0560;

The console is kicking back at me with:

"ERROR 1367 (22007): Illegal double '3675E4340' value found during parsing

Reading this, I see two things:

  1. It's finding the value twice (which I want because I want it to pull all the rows for that value.
  2. It's cutting off the value 5 digits short.

Is it only going to the 9th digit of the value for some reason other than it found a duplicate? How to I get it to print the duplicate values?

Upvotes: 0

Views: 120

Answers (1)

juergen d
juergen d

Reputation: 204924

You forgot the quotes around your string

SELECT * FROM jos_mls WHERE mstlistbrd = '3675E4340E0560'

Without them it tries to interpret it as number which fails and gives you the error you got.

Upvotes: 4

Related Questions