Results with leading zero - Mailing list pgsql-sql

From novice
Subject Results with leading zero
Date
Msg-id ddcb1c340806151848g3f177a06sfb5bf0f88c9adde@mail.gmail.com
Whole thread Raw
Responses Re: Results with leading zero
Re: Results with leading zero
Re: Results with leading zero
List pgsql-sql
I have a table

CREATE TABLE problem ( problem_id  integer, solution_count integer );

INSERT INTO problem VALUES (1001, 4);
INSERT INTO problem VALUES (1012, 11);

SELECT * from problem;
problem_id | solution_count
------------+---------------      1001 |             4      1012 |            11
(2 rows)


Is there a way I could write a query to produce the following?  I will
need the leading zero for solution < 10
problem_id | solution
-------------+------------       1001 | 01       1001 | 02       1001 | 02       1001 | 04       1012 | 01       1012 |
02      1012 | 03       1012 | 04       1012 | 05       1012 | 06       1012 | 07       1012 | 08       1012 | 09
1012| 10       1012 | 11
 
(15 rows)

Thanks.


pgsql-sql by date:

Previous
From: Andreas
Date:
Subject: How to manage category-ids as array-fields ?
Next
From: Andreas Guenzel
Date:
Subject: Re: Results with leading zero