-- SQL Server / Microsoft Access
SELECT FirstName + ' ' + LastName As FullName FROM Customers
Oracle uses the CONCAT(string1, string2) function or the || operator. The Oracle CONCAT function can only take two strings so the above example would not be possible as there are three strings to be joined (FirstName, ' ' and LastName). To achieve this in Oracle we would need to use the || operator which is equivalent to the + string concatenation operator in SQL Server / Access.
-- Oracle
SELECT FirstName || ' ' || LastName As FullName FROM Customers
MySQL uses the CONCAT(string1, string2, string3...) function. The above example would appear as follows in MySQL
-- MySQL
SELECT CONCAT(FirstName, ' ', LastName) As FullName FROM Customers
ไม่มีความคิดเห็น:
แสดงความคิดเห็น