在 SQl 中加入名称

Joining name in SQl

我是 SQL 的新手,我的任务是加入 MySQL 中演员的名字和姓氏。

select first_name ||''|| last_name name
from actor
order by actor_id;

我这样做了,但没有用。我得到的只是一串零。像

0
0
0
0
0
0
0
0
0

如果有人能帮我解决这个问题。那就太好了。

使用 concat() 函数...

select concat(first_name, ' ', last_name) as name
from actor 
order by actor_id;

试试这个..希望这有帮助

尝试使用Concat函数

select CONCAT(first_name, last_name) AS name
from actor
order by actor_id;

更多详细信息 here