Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Re: Slightly OT - SQL Question

by cchampion (Curate)
on Sep 20, 2003 at 13:32 UTC ( #292852=note: print w/ replies, xml ) Need Help??


in reply to Re: Slightly OT - SQL Question
in thread Slightly OT - SQL Question

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.


Comment on Re: Re: Slightly OT - SQL Question
Replies are listed 'Best First'.
Re: Re: Re: Slightly OT - SQL Question
by mpeppler (Vicar) on Sep 20, 2003 at 17:33 UTC
    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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://292852]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (12)
As of 2015-07-30 12:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (271 votes), past polls