Re: Grouping My query

From: "Martin Kuria" <martinkuria(at)hotmail(dot)com>
To: dev(at)archonet(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Grouping My query
Date: 2006-11-02 05:43:51
Message-ID: BAY117-F3516F86E56BD35E059E820A6FF0@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dear Richard,

Thanks for your response, you are right I am trying to do headings, I
thought I could do it from writing a SQL statement, but as you have
suggested it can only be achieved on the client code, I wish one day it can
be achieved with a SQL Statament thanks again .

Kind Regards.
+-----------------------------------------------------+
| Martin W. Kuria (Mr.) martin(dot)kuria(at)unon(dot)org
+----------------------------------------------------+

>From: Richard Huxton <dev(at)archonet(dot)com>
>To: Martin Kuria <martinkuria(at)hotmail(dot)com>
>CC: pgsql-general(at)postgresql(dot)org
>Subject: Re: [GENERAL] Grouping My query
>Date: Wed, 01 Nov 2006 18:50:46 +0000
>
>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

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-11-02 06:31:25 Re: Encoding, Unicode, locales, etc.
Previous Message Uwe C. Schroeder 2006-11-02 04:37:58 Re: time value '24:00:00'