pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Justin Clift <justin@postgresql.org>
To: u95886230@spawnkill.ip-mobilphone.net
To: pgsql-general@postgresql.org
Subject: Re: sql question
Date: Tue, 15 May 2001 20:45:03 +1000
Message-ID: <3B0108AF.13982832@postgresql.org> (raw)
References: <l.989779505.1960693359@[212.171.170.132]>

Hi,

I don't know if it's useful, but there are a number of SQL tutorials
available at
http://www.newbienetwork.net/sections.php?op=listarticles&secid=5 and
there is a list of all sorts of useful PostgreSQL & SQL resources
(including tutorials) at http://techdocs.postgresql.org/oresources.php

:-)

Regards and best wishes,

Justin Clift

u95886230@spawnkill.ip-mobilphone.net wrote:
> 
> Please help, I am trying to write an SQL statement but with no success as I am just
> starting out with sql.
> 
> I have a table with 3 columns: Account# ,OrderType and date
> example of data:
> Account#    &brvbar;   Ordertype  &brvbar; Date
> 1           &brvbar;   A          &brvbar; April
> 1           &brvbar;   B          &brvbar; May
> 1           &brvbar;   B          &brvbar; May
> 2           &brvbar;   B          &brvbar; April
> 2           &brvbar;   B          &brvbar; May
> 2           &brvbar;   C          &brvbar; May
> 3           &brvbar;   C          &brvbar; May
> 
> I need to write a select that will show me the totals of EACH type for EACH account AND
> total ordersplaced for a SPECIFIC month eg..Show me the results for May...
> 
> account &brvbar; TotA  &brvbar; TotB  &brvbar; TotC  &brvbar; Total
> 1       &brvbar; 0     &brvbar; 2     &brvbar; 0     &brvbar; 2
> 2       &brvbar; 0     &brvbar; 1     &brvbar; 1     &brvbar; 2
> 3       &brvbar; 0     &brvbar; 0     &brvbar; 1     &brvbar; 1
> 
> I can use temp tables, but need a solution written as basic as pssible so I can understand
> it (all in the form select this from that)
> any help would be fantastic as I am completely stuck and have been trying for about a week
> 
> thanks
> sgebbie@ciaoweb.it
> 
> 
> --
> Sent by sgebbie from  ciaoweb piece from  it
> This is a spam protected message. Please answer with reference header.
> Posted via http://www.usenet-replayer.com/cgi/content/new
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
> http://www.postgresql.org/search.mpl

-- 
"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
     - Indira Gandhi



view thread (71+ messages)  latest in thread

Message-ID: <3B0108AF.13982832@postgresql.org>
Permalink:  ../3B0108AF.13982832@postgresql.org/
Also on:    postgresql.org/message-id/3B0108AF.13982832@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: justin@postgresql.org, u95886230@spawnkill.ip-mobilphone.net
  Subject: Re: sql question
  In-Reply-To: <3B0108AF.13982832@postgresql.org>
  References: <l.989779505.1960693359@[212.171.170.132]> <3B0108AF.13982832@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox