I am trying to CONCAT the DATA FROM my EMPLOYEE TABLE
TABLE EMPLOYEE
==============================================
empno ename Job salary deptno
----------------------------------------------
101 Roy Programmer 5000 20
102 Todd Analyst 6000 10
105 Leslie Analyst 5500 20
107 Cindy Developer 7200 30
with these queries
SELECT CONCAT(ename || 'is getting paid' || salary || 'for' || job)
FROM EMPLOYEES
WHERE empno = 101;
-- and
SELECT CONCAT(ename, 'is getting paid', salary, 'for', job)
FROM EMPLOYEES
WHERE empno = 101;
But both result in the error:
SQL Error [1]: [SQLITE_ERROR] SQL error or missing database (no such function: CONCAT)'
Expected Output:
"Roy is getting paid 5000 for Programmer"
Please assist!
Use the concatenation operator || to concatenate strings. (As you actually already did.)
SELECT ename || ' is getting paid ' || salary || ' for ' || job
FROM employees
WHERE empno = 101;
The search result for concat in the sqlite documenation did not return any meaningfull hits.
The || operator is "concatenate" - it joins together the two strings of its operands
So it seems that there is no function concat(). But as mentionend above the operator || can be used.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With