当前位置: 动力学知识库 > 问答 > 编程问答 >

sql - How to get output like below?

问题描述:

In Oracle DB there is one table called Employees having data like below.

emp_first_name emp_surname city

------------------------------------------

Anil Shaw Gurgaon

Mukesh Jadav Pune

Write a SQL query to produce output like below. The first name should have 8 characters.

Anil Shaw

Gurgaon

Mukesh Jadav

Pune

网友答案:
SELECT RPAD( emp_first-name, 8, ' ' ) || ' ' || emp_surname || CHR(10) || city
FROM   Employees;
分享给朋友:
您可能感兴趣的文章:
随机阅读: