From: | DIB Walid <walid(dot)dib(at)inrialpes(dot)fr> |
---|---|
To: | wahab(at)mimos(dot)my |
Cc: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: SQl query |
Date: | 2003-05-07 09:00:04 |
Message-ID: | 200305070900.h47906k21567@imap-serv.inrialpes.fr |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
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(at)postgresql(dot)org)
From | Date | Subject | |
---|---|---|---|
Next Message | A.Bhuvaneswaran | 2003-05-07 09:21:47 | Re: SQl query |
Previous Message | Victor Yegorov | 2003-05-07 08:57:28 | Re: SQl query |