Can somebody explain me why does this mysql query

SELECT * FROM mytable WHERE F='d2f2' AND Tot>Pmin AND Tot<Pmax

omit this row

ID ¦IDa¦F ¦Pmax¦Pmin¦Tot

124¦160¦d2f2¦200 ¦12 ¦182

thanks!

Recommended Answers

All 4 Replies

Show a SQL dump of that row.

Is the data types are identical on columns Pmin, Pmax and Tot?

Yes it's all INT

I did it in MS SQL and got the expected results. Is it possible that the actual value of F iin the table is 'd2f2 ' or some such instead of 'd2f2'? Try the query

SELECT * FROM mytable WHERE F LIKE '%d2f2%' AND Tot > Pmin AND Tot < Pmax

or

SELECT * FROM mytable WHERE F = 'd2f2'

and see what you get

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.