How do you use CONCAT function on DEBEAVER environment. Thanks in advance
CONCAT(CustomerID, " ", CustomerName)
CodePudding user response:
SELECT CONCAT(City , " ", Country) FROM customers c this returns an error also says : SQL Error [1]: [SQLITE_ERROR] SQL error or missing database (no such function: CONCAT)
CodePudding user response:
In SQLite, The ||
operator is "concatenate" - it joins together the two strings of its operands.
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;
Result:
customer_Id_and_Name|
--------------------
101 Adam |
102 Eve |
By the way, it's not limited in DBeaver. You can run the query in any SQLite query tools:
- sqlite3 (cli) - https://sqlite.org/cli.html
- SQLiteStudio - https://sqlitestudio.pl
- DB Browser for SQLite - https://sqlitebrowser.org