Re: SQL Query Quandry

From: Chris Hohmann (nospam_at_thankyou.com)
Date: 04/19/04


Date: Mon, 19 Apr 2004 11:02:24 -0700


"Laphan" <news@DoNotEmailMe.co.uk> wrote in message
news:4082d9f1_3@127.0.0.1...
> Dear Chris
>
> I don't know how the hell you could make something out of my ramblings
and I
> did doubt it when I put it through Query Analyser, but it is
absolutely spot
> on when put through a Pivot Table!!!
>
> This union thing is completely different to what I expected.
>
> How the hell do you guys do it???
>
> I've got 2 SQL books (1 called Sams 24 hour SQL and the other 'the
Practical
> SQL handbook') and neither gives me any clue on how to do the things
that
> you guys know. Its so frustrating!!
>
> Do you know of a place/site that will explain this sort of thing to me
in a
> 'I'm thick - help me' sort of way??
>
> Many thanks all the same.

Most of what I know (which believe it or not is very little) comes from
fields combat/trial by fire. Joe Celko's insights in relational
databases are pretty amazing. I frequently filter my google group
searches with him as the author when I want the "definitive" answer to
something. His book "SQL for Smarties" is also a must have. And, as
always this newsgroup can be an excellent resource for your ASP/DB
related questions. There's no real black magic in the query I provided.
I simply added a dummy/filler set of data to create all the rows/columns
needed. That's what the second query is. Omitting the WHERE/JOIN clause
creates a Cartesian product, i.e. every sales person matched up with
every stock category.

HTH
-Chris Hohmann



Relevant Pages

  • Re: SQL Query Quandry
    ... Chris Hohmann wrote in message ... > I don't know how the hell you could make something out of my ramblings ... > SQL handbook') and neither gives me any clue on how to do the things ... There's no real black magic in the query I provided. ...
    (microsoft.public.inetserver.asp.db)
  • Re: from pgsql_perl5 to DBD-Pg
    ... The previous post formatted like hell. ... # Returns the number of records in the query result: ... # Prints out all the records in an intelligent manner: ...
    (perl.dbi.users)
  • Mysterious problem with INSERT query
    ... I am having a hell of a time with what I think is a very simple query: ... Query generated by phpMyAdmin and pasted into my PHP doesn't work ...
    (comp.lang.php)