sqlite 如何在SQL Lite环境中使用CONCAT?

toiithl6  于 2022-12-19  发布在  SQLite
关注(0)|答案(1)|浏览(341)

如何在DEBEAVER环境下使用CONCAT函数。提前感谢
第一个月

z9smfwbn

z9smfwbn1#

在SQLite中,||操作符是"concatenate"-它将其操作数的两个字符串连接在一起。

create table customer (
   customerId   int, 
   customerName text);

insert into customer
values
(101, 'Adam'),
(102, 'Eve');

select customerId || ' ' || customerName as customer_Id_and_Name
  from customer;

结果:

customer_Id_and_Name|
--------------------+
101 Adam            |
102 Eve             |

顺便说一下,它不限于DBeaver,你可以在任何SQLite查询工具中运行查询:

相关问题