Re: sql question

From: Justin Clift <justin(at)postgresql(dot)org>
To: u95886230(at)spawnkill(dot)ip-mobilphone(dot)net, pgsql-general(at)postgresql(dot)org
Subject: Re: sql question
Date: 2001-05-15 10:45:03
Message-ID: 3B0108AF.13982832@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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(at)spawnkill(dot)ip-mobilphone(dot)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(at)ciaoweb(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message D'Arcy J.M. Cain 2001-05-15 11:19:01 Re: [HACKERS] Internet is putting lot of competition fire & heat under Microsoft SQL Server
Previous Message Justin Clift 2001-05-15 10:40:08 Re: Re: Internet is putting lot of competition fire & heat under Microsoft SQL Server