View unanswered posts | View active topics It is currently Mon Dec 17, 2018 3:01 am



Reply to topic  [ 1 post ] 
 SELECT WHERE IN problem? 
Author Message
Junior Member

Joined: Wed May 02, 2007 7:01 pm
Posts: 1
Post SELECT WHERE IN problem?
Using mySQL 4.1

This returns the correct count:

Code:
[color=#933]SQL:[/color]
SELECT COUNT(*) FROM "._MY_TABLE." WHERE ts
BETWEEN '2007-01-01 00:00:00' AND '2008-01-01 00:00:00'
AND pcode IN ('aew', 'sdd')




This ignores the IN clause and returns all rows between the dates:

Code:
[B][color=#933]SQL:[/color][/B]
SELECT email, l_name, state FROM "._MY_TABLE." WHERE ts
BETWEEN '2007-01-01 00:00:00' AND '2008-01-01 00:00:00'
AND pcode IN ('aew', 'sdd')




Suggestions?

thx.


Wed May 02, 2007 7:08 pm
Report this post
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.