Re: Advanced SQL statements writing

From: joel garry <joel-garry_at_home.com>
Date: Mon, 20 Apr 2009 12:21:10 -0700 (PDT)
Message-ID: <06c88a5b-9d78-48c5-8ae9-a8e04b8ddeb8_at_y6g2000prf.googlegroups.com>



On Apr 16, 7:26 am, Michael Austin <maus..._at_firstdbasource.com> wrote:
> Phper wrote:
> > I wrote this SQL statement:
>
> > SELECT *
> > FROM  ((SELECT piecework_id,1+count(*)
> > FROM view
> > GROUP BY piecework_id) AS view1
> > LEFT OUTER JOIN
> > (SELECT piecework_id, sum(status)
> > FROM submission
> > GROUP BY piecework_id) AS submission1
> > on view1.piecework_id=submission1.piecework_id);
>
> > It can be executed successfully.
> > This is the result.
> > piecework_id       1+count(*)      piecework_id    sum(status)
> > 8                        2                    8                      NULL
> > 989                              2                    NULL                    NULL
>
> > But I want the result to be
> > piecework_id       1+count(*)      sum(status)
> > 8                        2                  NULL
> > 989                              2                  NULL
>
> > How can I achieve this?
>
> you are really starting to annoy me. you have asked so many very basic
> questions, it makes me wonder if you are just a troll. If you really do
> not understand what the heck you are doing, you might want to find
> another line of work or go to school.
>
> You achieve this by breaking you query down into parts, testing and more
> testing.  you have too many sub-selects which is another indication you
> are clueless.  Get a good book on SQL, start up an Oracle database and
> start testing.

I sure hope this guy isn't a troll about to use these questions to try to make money off our work with no attribution: http://groups.google.com/group/Making-your-Website-Sell/browse_thread/thread/badbf6cf41c1539d/2e532ebe84c3e03f#2e532ebe84c3e03f

How about it Phper? Is that what you are doing? You will get extreme flamage from me if that is what this is all about. We've seen several of those "blogs" where people just rip off other people's work for the purpose of click income (or even ripoffs for book income), and it is plain reprehensible, and often illegal.

That is something that might go in the minifaq. Just thinking about it, I'm getting steamed.

jg

--
_at_home.com is bogus.
Arrrr, pirates:
http://www3.signonsandiego.com/stories/2009/apr/18/1b18copies215552-file-share-web-sites-operators-co/?uniontrib
Received on Mon Apr 20 2009 - 14:21:10 CDT

Original text of this message