Results 1 to 4 of 4
November 9th, 2002, 11:31 AM #1
What is the best way to query a mySQL database to display information that matches two criteria. When I use AND in my query it fails. Each criteria by itself produces results but no results used together. I tried many ways but can't understand why this query won't work.
WHERE Price < '1000.00' AND PriCategory LIKE '%WordsInACategory%'
ORDER BY TigerDirect.Price
When I run the WHERE Price < '1000.00' query I get results and when I run the PriCategory LIKE '%WordsInACategory%' I get results, so why don't I get any results when both are used?
November 9th, 2002, 02:38 PM #2
November 9th, 2002, 03:13 PM #3
I just tried this on the tiger datafeed loaded into MySQL and it worked fine.
WHERE retail_price < '1000.00'
and primary_cat like '%network%'
ORDER BY tiger.retail_price
The quotes on the price don't matter. It works either way.
November 9th, 2002, 03:22 PM #4
Thanks much! You're good. The select statement was ok but I had price set to varchar. I changed it to decimal and the statement works now. After about 3 hours of playing with it...
Anyway, thanks again. I wanted to do a sort of TD systems by price and needed to have both requirements. Appreciate it!! [img]/infopop/emoticons/icon_biggrin.gif[/img]
By sotonman in forum WebMerge (Fourthworld.com)Replies: 6Last Post: August 16th, 2006, 05:55 AM
By sholto in forum WebMerge (Fourthworld.com)Replies: 1Last Post: August 5th, 2005, 01:59 AM
By Allen Nance in forum Suspicious Activity!Replies: 7Last Post: April 4th, 2005, 07:30 AM
By ~Michelle in forum Rakuten LinkShare - LSReplies: 14Last Post: December 26th, 2003, 07:19 AM