简体   繁体   中英

Select “Name” + ( ':__________') from table

I have select:

select name from table

My answer is:

Alex

Is it possible somehow to get a response, "Alex: __________" on my select?

Use string concatenation:

SELECT name || ': __________' FROM table

However, I would question whether this is really the job for an SQL query or whether you should be doing the formatting in whatever middle tier language is calling the database.

Perhaps you want a fix length of the answer then you should use something like:

SELECT RPAD(name || ': ', 30,'_') from table

you can use CONCAT function

select CONCAT(name,': __________' ) from table

look this link how to use details: https://www.w3resource.com/oracle/character-functions/oracle-concat-function.php

select EmployeeName + ':___________' from Employee

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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