Re: [SQL] count question

2008-04-08 Thread ashish
Volkan YAZICI wrote: > On Wed, 9 Apr 2008, novice <[EMAIL PROTECTED]> writes: > >> Is it possible to write a query to produce: >> >> meter_id | no_of_bays | bay_id >> --++--- >> 5397 | 2 | 5397-01 >> 5397 | 2 | 5397-02 >> 5409 |

Re: [SQL] count question

2008-04-08 Thread Volkan YAZICI
On Wed, 9 Apr 2008, novice <[EMAIL PROTECTED]> writes: > Is it possible to write a query to produce: > > meter_id | no_of_bays | bay_id > --++--- > 5397 | 2 | 5397-01 > 5397 | 2 | 5397-02 > 5409 | 3 | 5409-01 > 5409

Re: [SQL] count question

2008-04-08 Thread rdeleonp
On 4/8/08, Craig Ringer <[EMAIL PROTECTED]> wrote: > novice wrote: > > > Is it possible to write a query to produce: > > > > meter_id | no_of_bays | bay_id > > --++--- > > 5397 | 2 | 5397-01 > > 5397 | 2 | 5397-02 > > 5409 |

Re: [SQL] count question

2008-04-08 Thread Craig Ringer
novice wrote: > Is it possible to write a query to produce: > > meter_id | no_of_bays | bay_id > --++--- > 5397 | 2 | 5397-01 > 5397 | 2 | 5397-02 > 5409 | 3 | 5409-01 > 5409 | 3 | 5409-02 > 5409 |

[SQL] count question

2008-04-08 Thread novice
i have a table CREATE TABLE meter ( meter_id integer NOT NULL, no_of_bays integer, CONSTRAINT meter_pkey PRIMARY KEY (meter_id) ) INSERT INTO meter( meter_id, no_of_bays) VALUES (5397, 2); INSERT INTO meter( meter_id, no_of_bays) VALUES (5409, 3); select