Re: Which query is more correct?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 20 Nov 2009 16:41:58 -0600, LAMP wrote:

> SELECT r.*
> FROM registrants r
> where r.reg_status=1 AND r.reg_id NOT IN (SELECT tbrc_reg_id FROM 
> toberecleared)
> 
> 
> SELECT r.*
> FROM registrants r
> where r.reg_status=1 AND (SELECT count(*) FROM toberecleared where 
> tbrc_reg_id=r.reg_id) = 0
> 
> I checked explain of bot queries - but can't "read" them.  :-)

Like Ashley, I'd probably go with the first one. The other
one seems a little backwards. Out of curiosity, what *does*
EXPLAIN say about them?


/Nisse

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux