Re: SQl query - Mailing list pgsql-sql

From Victor Yegorov
Subject Re: SQl query
Date
Msg-id 20030507085728.GQ17892@nordlb.lv
Whole thread Raw
In response to SQl query  (Abdul Wahab Dahalan <wahab@mimos.my>)
List pgsql-sql
* Abdul Wahab Dahalan <wahab@mimos.my> [07.05.2003 11:52]:
> 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

selecttransporttype,count(transporttype)
fromyour_table
group bytransporttype;


--

Victor Yegorov

pgsql-sql by date:

Previous
From: Matthew Horoschun
Date:
Subject: Re: SQl query
Next
From: DIB Walid
Date:
Subject: Re: SQl query