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
[email protected] 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# ¦ Ordertype ¦ Date
> 1 ¦ A ¦ April
> 1 ¦ B ¦ May
> 1 ¦ B ¦ May
> 2 ¦ B ¦ April
> 2 ¦ B ¦ May
> 2 ¦ C ¦ May
> 3 ¦ C ¦ 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 ¦ TotA ¦ TotB ¦ TotC ¦ Total
> 1 ¦ 0 ¦ 2 ¦ 0 ¦ 2
> 2 ¦ 0 ¦ 1 ¦ 1 ¦ 2
> 3 ¦ 0 ¦ 0 ¦ 1 ¦ 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
> [email protected]
>
>
> --
> 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