Re: GROUPING and ORDERING and CONFUSION - Mailing list pgsql-sql

From Tim Johnson
Subject Re: GROUPING and ORDERING and CONFUSION
Date
Msg-id NBBBLHOPPPPCHCIABAFGKELNCJAA.tim@celestialdesign.co.uk
Whole thread Raw
Responses Re: Re: GROUPING and ORDERING and CONFUSION  ("Ross J. Reedstrom" <reedstrm@wallace.ece.rice.edu>)
List pgsql-sql
Hello,

I was hoping somebody might be able to help me do this: I have a table with
two fields (num int, name text)

num   | name
----------------------------------------------
15    | First Category Heading
1510  | first category subheading
1511  | second category subheading
1560  | spurious category subheading
156010| first spurious category subheading
156011| second spurious category subheading
16    | Second Category Heading
1610  | Second category subheading
161010| Second category subheading subheading

and so on...

My problem is I want to pull that data out and group it so that it comes out
just the way it went in.. So my page can read:

15: First Category Heading1510: first category subheading1511: second category subheading
16: ... and so on..



I thought I could probably group by num on the first two digits and order by
asc? but I can't find a way to make that work.

Thanks in advance.


Tim Johnson



pgsql-sql by date:

Previous
From: "tjk@tksoft.com"
Date:
Subject: Re: Finding out table names
Next
From: "Sean"
Date:
Subject: Check this