Re: sorting a 3d array?



Oliver Grätz 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.

1. This was an explicit response to "my query is too complicated" and
the whole complicated query should be encapsulated as a subquery.


I understand. And I still stand by my statement.

2. You are not stating your argument with any explanation. It reads like
"Blue is lame, red is much better."


Because SQL is not PHP, and this is a PHP newsgroup. But you can get a lot of help and explanation on how to structure your SQL statements in the appropriate newsgroup - such as comp.databases.mysql. That's where the MySQL experts hang out.

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.


Just because they are legal doesn't mean they are correct. There are many reasons why JOINs are better.

4. Please stop full-quoting when you are in fact just anserinfg to one
sentence.

OLLi


Please learn to post SQL questions in a SQL newsgroup. This is a PHP newsgroup, in case you haven't noticed the name.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================

.



Relevant Pages

  • Re: Create SELECT COUNT from given statement
    ... but I don't know that it supports derived table subqueries in the FROM clause like that. ... run a few sample queries using both the derived-table subquery method and the straight SELECT COUNT... ... the whole SQL and create a new counting statement or do todays DB-Engines a good job on optimizing this? ...
    (comp.databases)
  • Re: SQL Query Question: Avoiding Subqueries
    ... if your problem is the number of subqueries and joins, ... "Ken Dibble" schrieb im Newsbeitrag ... > possible SQL SELECT statements. ... >>> SQL Query Question: ...
    (microsoft.public.fox.programmer.exchange)
  • CBO Subquery Limitations
    ... Oracle 9.2.0.6 EE on Windows ... evaluating SQL with subqueries in 9i. ... It appears that it will Unnest subqueries whenever possibe without any ...
    (comp.databases.oracle.server)
  • Re: SQL Statement Help
    ... I've been trying to get this SQL, but I just can't get it to work. ... Daniel A. Morgan ... Puget Sound Oracle Users Group ... I would split your query into two subqueries. ...
    (comp.databases.oracle.misc)
  • Re: sorting a 3d array?
    ... Jerry Stuckle schrieb: ... Subqueries are almost never correct. ... the whole complicated query should be encapsulated as a subquery. ... Subqueries are aqn important part of SQL nad the fact that they can ...
    (comp.lang.php)