Re: output a single and double quote in a string - Mailing list pgsql-novice

From George Weaver
Subject Re: output a single and double quote in a string
Date
Msg-id 00c501c52c10$1d442030$6400a8c0@Dell4500
Whole thread Raw
In response to output a single and double quote in a string  ("Keith Worthington" <keithw@narrowpathinc.com>)
Responses Re: output a single and double quote in a string
List pgsql-novice
----- Original Message -----
From: "Keith Worthington" <keithw@narrowpathinc.com>
To: "PostgreSQL Novice" <pgsql-novice@postgresql.org>
Sent: Friday, March 18, 2005 3:41 PM
Subject: [NOVICE] output a single and double quote in a string


> Hi All,
>
> I am trying to create output that contains a dimension and the user would
> like
> to see single quote for feet and double quote for inches.  I have not as
> yet
> stumbled on the solution.

How about

SELECT length_ft::text || chr(39)
        length_in::text || \' " \' AS length_dim,
        width_ft::text || chr(39) ||
        width_in::text || \' " \' AS width_dim
   FROM sales_order.tbl_net_production;

>
> SELECT length_ft::text || \' ||
>        length_in::text || \" AS length_dim,
>        width_ft::text || \' ||
>        width_in::text || \" AS width_dim
>   FROM sales_order.tbl_net_production;
>
> Kind Regards,
> Keith
>
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend
>



pgsql-novice by date:

Previous
From: "Morgan Kita"
Date:
Subject: Best way to input data
Next
From: Sean Davis
Date:
Subject: Re: Best way to input data