So I have a varchar column which is supposed to store product prices( don’t ask me how I ended up with that, but now I have no option of changing this…sigh ), It can also be blank, or contain one of the texts(literally) “null”,”OUT” where both represents a price of 0. What is the best and most efficient way to find the MIN and MAX value of this column?
PS: I am open to php/mysql hybrid solutions, cause I need the most optimized and efficient way for this. This table is really huge…
Something like this should work and be reasonably efficient. It’s not going to be fast in any case, though.
After testing this, I noticed that apparently the casting is done automatically, so you can just do: