|
Posted by Rik Wasmus on 12/03/07 11:38
On Mon, 03 Dec 2007 12:00:05 +0100, Oliver Grätz <oliver.graetz@gmx.de>
wrote:
> Jerry Stuckle schrieb:
>> Oliver Grätz wrote:
>>> If your query is "too complicated", you can always
>>> work with subqueries:
>>>
>>> SELECT wanted_field_1,wanted_field_2
>>> FROM (SELECT with your complicated query)
>>> AS subtable [...]
>>
>> Subqueries are almost never correct. Joins are much better.
>
> 2. You are not stating your argument with any explanation. It reads like
> "Blue is lame, red is much better."
Which is why this should be a discussion in some sql-related ng in which
case more details and background can and will be stated.
> 3. Subqueries are aqn important part of SQL nad the fact that they can
> often be replaced by joins does not render them incorrect. There is
> always more than one way to do it.
General concensus is joins are both more portable and in most cases a lot
faster. You can use subqueries offcourse, that doesn't mean it's the best
solution. In php <?=$foobar ?> is possible, yet we all strongly advise
against it...
--
Rik Wasmus
Navigation:
[Reply to this message]
|