This is a multi-part message in MIME format.
--------------000000070801060401050905
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Volkan YAZICI wrote:
> On Wed, 9 Apr 2008, novice <user.postgresql@[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 | 3 | 5409-02
>> 5409 | 3 | 5409-03
>>
>
> Shouldn't this function be the responsitibility of client software,
> instead of database?
>
>
> Regards.
>
May be this will help you
a****sh=# select
meter_id,no_of_bays,meter_id||'-'||generate_series(1,no_of_bays) from
meter;
meter_id | no_of_bays | ?column?
----------+------------+----------
5397 | 2 | 5397-1
5397 | 2 | 5397-2
5409 | 3 | 5409-1
5409 | 3 | 5409-2
5409 | 3 | 5409-3
With Regards
A****sh
===================================================================
sms START NETCORE to 575758 to get updates on Netcore's enterprise
products and services
sms START MYTODAY to 09845398453 for more information on our mobile
consumer services or go to http://www.mytodaysms.com
===================================================================
--------------000000070801060401050905
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=us-ascii" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Volkan YAZICI wrote:
<blockquote cite="mid:87ej9fr3kh.fsf@[EMAIL PROTECTED]
" type="cite">
<pre wrap="">On Wed, 9 Apr 2008, novice <a class="moz-txt-link-rfc2396E"
href="mailto:user.postgresql@[EMAIL PROTECTED]
"><user.postgresql@[EMAIL PROTECTED]
>
writes:
</pre>
<blockquote type="cite">
<pre wrap="">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 | 3 | 5409-03
</pre>
</blockquote>
<pre wrap=""><!---->
Shouldn't this function be the responsitibility of client software,
instead of database?
Regards.
</pre>
</blockquote>
<br>
May be this will help you<br>
<br>
<br>
a****sh=# select
meter_id,no_of_bays,meter_id||'-'||generate_series(1,no_of_bays) from
meter;<br>
meter_id | no_of_bays | ?column?<br>
----------+------------+----------<br>
5397
| 2 | 5397-1<br>
5397
| 2 | 5397-2<br>
5409
| 3 | 5409-1<br>
5409
| 3 | 5409-2<br>
5409
| 3 | 5409-3<br>
<br>
With Regards<br>
A****sh<br>
</body>
<pre>
===================================================================
sms START NETCORE to 575758 to get updates on Netcore's enterprise
products and services
sms START MYTODAY to 09845398453 for more information on our mobile
consumer services or go to http://www.mytodaysms.com
===================================================================
</pre>
</html>
--------------000000070801060401050905--


|