简体   繁体   English

如何格式化Oracle SQL查询

[英]How to format Oracle SQL query

I have this excursie 我有这次旅行

Write the query, showing prices of all products in one column with the following condition: "The price [Product Name] is [Price] lv. 编写查询,在满足以下条件的一列中显示所有产品的价格:“价格[产品名称]为[价格] lv。

The table looks like this 桌子看起来像这样

http://i52.tinypic.com/2s60bkn.png

If I understood your question correctly, what you are looking for is the concatenation operator || 如果我正确理解了您的问题,那么您正在寻找的是串联运算符||。

You can produce the product name and price in one column like this 您可以像这样在一栏中生成产品名称和价格

SELECT 'The price of [' || PRODNAME || '] is [' || PRODAJNACENA || '] lv' 
FROM your_table_name;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM