pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: DIB Walid <walid.dib@inrialpes.fr>
To: wahab@mimos.my
Cc: pgsql-sql@postgresql.org
Subject: Re: SQl query
Date: Wed, 7 May 2003 11:00:04 +0200
Message-ID: <200305070900.h47906k21567@imap-serv.inrialpes.fr> (raw)
In-Reply-To: <3EB8C1C5.4745E77E@mimos.my>
References: <3EB8C1C5.4745E77E@mimos.my>

Hello,
here is a suggestio:

select transporttype, count(transportid) as number of transport
from transport
group by transporttype;

@+
Walid

Le Mercredi 7 Mai 2003 10:20, vous avez écrit :
> If I've a transport table like this:
>  transporttype | transportid
> ---------------+-------------
>  Lorry         |        1037
>  Pickup        |        1038
>  Lorry         |        1040
>  Lorry         |        1045
>  Pickup        |        1046
>  Lorry         |        1047
>
> How do I make a query so that I get a result like
>
>  transporttype | #of transport
> ---------------+-------------
>  Lorry            |        4
>  Pickup          |        2
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)




view thread (18+ messages)  latest in thread

Message-ID: <200305070900.h47906k21567@imap-serv.inrialpes.fr>
Permalink:  ../200305070900.h47906k21567@imap-serv.inrialpes.fr/
Also on:    postgresql.org/message-id/200305070900.h47906k21567@imap-serv.inrialpes.fr

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: walid.dib@inrialpes.fr, wahab@mimos.my
  Subject: Re: SQl query
  In-Reply-To: <200305070900.h47906k21567@imap-serv.inrialpes.fr>

* 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