0
如何修剪DB2中select查詢中列的前三個字符?我想下面的查詢,但沒有奏效修剪DB2中的前3個字符
SELECT
MIN(Column1),UPPER(RIGHT(Column2, LENGTH(Column2 - 3))) AS TEST
FROM TEST_TABLE
GROUP BY UPPER(Column2)
ORDER BY UPPER(Column2);
我得到異常
The statement cannot be processed.
User response:
Correct the statement by including the expression in the GROUP BY clause
that are in the SELECT clause, HAVING clause, or ORDER BY clause or by
removing the column function from the SELECT statement.
sqlcode: -119
sqlstate: 42803
什麼意思',但沒有奏效'? – Jens
@Jens我得到下面的異常....聲明無法處理。 用戶響應: 通過包括BY子句 是SELECT子句中的組的表達,HAVING子句或ORDER BY子句或通過 從SELECT語句除去列函數更正語句。 sqlcode:-119 sqlstate:42803 – Hari