I have a database where one of the fields is for bathrooms
and users usually input 1
or 3
or sometimes 1.1
which means 1 full bathroom and 1 half bathroom so I couldn't store this field as number, integer or double, or decimal. I had to store them as text.
My question is, how can I do this in a query if I wanted to pull only those records who's bathrooms is greater than 3 or something? I am looking for something like:
SELECT * FROM agentdb WHERE converttointeger(bathrooms) => 3
Obviously converttointeger
is not valid but is there a way to achieve this? I tried searching and Googling but I keep getting the wrong results or wrong topic.