Jump to content

Archived

This topic is now archived and is closed to further replies.

centenial

Select records between 2 numbers

Recommended Posts

Hi,

I have a field called "price" in one of my MySQL database tables. I want to select ALL records between $1,000 & $25,000 - How can I do this?

Thanks,

Share this post


Link to post
Share on other sites
"SELECT * from `table_name` WHERE (`price` > '1000') AND (`price` < '25000')

im not sure about the brackets... so try this one also (`price` > '1000' AND `price` < '25000') lol... trial and error method.  8)

Share this post


Link to post
Share on other sites
Thanks!

Do the numbers in the "price" field have to be formatted in any particular way? Can I include dollar signs and commas in that field?

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.