Now, I'm migrating mssql to mariadb(mysql). Mssql has with clause(with A as ()), but mysql has not with clause. So I'm using "create temporary table", but some error occurred.
Example,
CREATE TEMPORARY TABLE TMP(
SELECT CAST(DATE_FORMAT(NOW(), '%Y-%m-%d %T.%f') AS CHAR(19)) AS REGDT
);
and this is error code
MySQL Database Error: Truncated incorrect CHAR(19) value: '2016-06-27 10:34:34.000000'
What is wrong?
This is my query.
CREATE TEMPORARY TABLE TMP(
SELECT DEPTCODE, DEPTNAME, USEYN, HIGHDEPTCODE,
CAST(DATE_FORMAT(REGDT, '%Y-%m-%d %T.%f') AS CHAR(19)) AS REGDT,
0 AS LEV, CAST(DEPTCODE AS CHAR(255)) AS SORT, DEPTORDER
FROM TBDEPARTMENT
WHERE DEPTCODE = '1000');
Aucun commentaire:
Enregistrer un commentaire