Re: [PHP] Help wtih a query?
- From: Satyam@xxxxxxxxxxxxx ("Satyam")
- Date: Wed, 31 Jan 2007 09:14:12 +0100
----- Original Message ----- From: "Jon Anderson" <jon@xxxxxxxxxxxxxxxxxx>
To: "Skip Evans" <skip@xxxxxxxxxxxxxxxxx>
Cc: "PHP-General" <php-general@xxxxxxxxxxxxx>
Sent: Tuesday, January 30, 2007 11:46 PM
Subject: Re: [PHP] Help wtih a query?
Wrong list. Putting "$sql=..." in there doesn't make it a PHP question. ;-)
Skip Evans wrote:Is that what the left/right joins do???Yea. LEFT JOIN will give you NULL entries in the left joined table, so you'd just have to say WHERE ISNULL(<left joined table>.<some field in that table>). Of course, you'll need to do the right JOINs in there for that to work.
Personally, I think that implicit joins are sloppy, so I would suggest using JOIN with ON or USING...but I suppose that's a preference thing, and some (all?) might disagree with me.
SQL engines have many techniques to improve the performance of the queries, with dozens of scholarly papers backing each slight improvement. The more the SQL engine knows about your intentions, the better chances it has to apply the best techniques to improve the performance of your query. For a particular engine, only a subset of all these tricks might be implemented so little might be gained from writing queries this way instead of that way and this might change with each version but it still holds that the chances for better performance improve if you make it clear what you want, eventually.
Satyam
jon.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
- References:
- Help wtih a query?
- From: Skip Evans
- Re: [PHP] Help wtih a query?
- From: Jon Anderson
- Help wtih a query?
- Prev by Date: Re: [PHP] regarding ereg() problem
- Next by Date: Re: [PHP] Parsing mail file [RESOLVED]
- Previous by thread: Re: [PHP] Help wtih a query?
- Next by thread: Re: [PHP] Help wtih a query?
- Index(es):
Relevant Pages
|