Jump to content


Photo

Select records between 2 numbers


  • Please log in to reply
2 replies to this topic

#1 centenial

centenial
  • Members
  • PipPipPip
  • Advanced Member
  • 59 posts

Posted 30 June 2006 - 11:52 PM

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,

#2 karthikeyan_coder

karthikeyan_coder
  • Members
  • PipPipPip
  • Advanced Member
  • 201 posts

Posted 01 July 2006 - 12:02 AM

"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)
www.karthi.us

#3 centenial

centenial
  • Members
  • PipPipPip
  • Advanced Member
  • 59 posts

Posted 01 July 2006 - 12:25 AM

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?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users