下面的SQL語句工作在MySQL,但沒有與Oracle:查詢工作在MySQL不是Oracle
SELECT *, MAX(COLUMN_A)
FROM table_xyz
WHERE COLUMN_A <= 100
GROUP BY COLUMN_A
甲骨文訴: 「FROM關鍵字未找到預期」
實際上被聲明爲不正確,我們不是按COLUMN_A分組,而是另一列。其實我們要的是這個
SELECT *, MAX(COLUMN_A)
FROM table_xyz
WHERE COLUMN_A <= 100
GROUP BY COLUMN_B
this works but gives us only column A and B
SELECT COLUMN_B, MAX(COLUMN_A)
FROM table_xyz
WHERE COLUMN_A <= 100
GROUP BY COLUMN_B
what we want is this, but it doesn't work (group by error)
SELECT COLUMN_B, COLUMN_C .... COLUMN_X, MAX(COLUMN_A)
FROM table_xyz
WHERE COLUMN_A <= 100
GROUP BY COLUMN_B
正確。您必須調整查詢。 – 2010-08-17 20:00:33
你能描述一下你實際想要達到的目標嗎?這個聲明根本沒有意義 – 2010-08-17 21:09:02