zay7sev
zay7sev

Reputation: 129

How to put text into SQL select statement

I have the following problem. We are using ORACLE Apex Application Express. We have database with some information inside. I need to write a SQL select that shows information but I have to follow one rule

"Price for 'row_name' is 'row_price' usd"

Where the row_name is the name of product and the row_price is sum(price1+price2).

Upvotes: 1

Views: 2712

Answers (1)

Mureinik
Mureinik

Reputation: 312344

You can use the || operator to concatinate strings:

SELECT 'Price for '                  || 
       prod_name                     || 
       ' is '                        || 
       TO_CHAR(delprice + sellprice) || 
       ' usd'
FROM   my_table

Upvotes: 3

Related Questions