Re: Grouping My query - Mailing list pgsql-general

From Richard Huxton
Subject Re: Grouping My query
Date
Msg-id 4548EC86.7010704@archonet.com
Whole thread Raw
In response to Grouping My query  ("Martin Kuria" <martinkuria@hotmail.com>)
Responses Re: Grouping My query  ("Martin Kuria" <martinkuria@hotmail.com>)
List pgsql-general
Martin Kuria wrote:
> Dear Sir/Madam,
>
> I have a staff directory, which group staff in various categories I
> would like to group the staff members in there specific categories,

>
> Below is an output I would like to achieve can this be achived my using
> the Group by or I can write a script to achieve the output below please
> do assist. As you can see the staff members are group in their
> respective Categories and Subcategory unlike the output above.
>
> staff_lname | staff_fname | staff_id | staff_catid | staff_subcatid |
> cat_acron | subcat_acron | staff_sortorder
> -------------+-------------+----------+-------------+----------------+-----------+--------------+-----------------
>
> ADSDS
> ODA
>  Vacant      | Vacant      |     8836 |         500 |            534 |
> ADSDS      | ODA         |               0
>  nnnnn       | aaaaa       |     7148 |         500 |            534 |
> ADSDS      | ODA         |               0
> WEB
>  bbbbb       | Sbbbbb      |     7150 |         500 |            534 |
> ADSDS      | WEB         |               1
>  xxxxx       | cccccc      |     7174 |         500 |            534 |
> ADSDS      | WEB         |               1
>  eeeee       | dddddd      |     7173 |         500 |            534 |
> ADSDS      | WEB         |               2

Am I right in thinking you're trying to do headings here?
   heading1: ADSDS
   heading2: ODA
   ...rows...
   heading2: WEB
   ...rows...

This is a formatting issue - do it in your client code. There are report
-generating systems available for many languages.

--
   Richard Huxton
   Archonet Ltd

pgsql-general by date:

Previous
From: Thomas Kellerer
Date:
Subject: Re: Compiling/Installing as a non-admin user
Next
From: Ritesh Nadhani
Date:
Subject: Re: Updated: Compiling/Installing as a non-admin user