in reply to Slightly OT - SQL Question

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: Re: Slightly OT - SQL Question
by cchampion (Curate) on Sep 20, 2003 at 13:32 UTC

    Please, don't answer if you don't know the the matter.

    • This is not correct SQL. An ORDER BY must come after a GROUP BY clause
    • Even if you find a DBMS that runs it, it will produce a CROSS JOIN, i.e. a result set with as many records in table1 multiply by as many records in table2.

    As for the original question, I am unable to answer because it is not clear to me if a member has many counties or a county has many members. The OP would be better off by asking this at comp.databases.

      Even if you find a DBMS that runs it, it will produce a CROSS JOIN, i.e. a result set with as many records in table1 multiply by as many records in table2.
      This is also known as a cartesian product. The query will produce that because there is no join information - i.e. no implicit link between the two tables in the WHERE clause, and no JOIN clause.

      Michael