Sorry, you can't group by a clob: You cannot specify LOB columns in the ORDER BY clause of a query, or in the GROUP BY clause of a query or in an aggregate function.
In Oracle, you can use LENGTH() or DBMS_LOB. GETLENGTH() function to get the length of a CLOB column in characters. There is LENGTHB() function to get the length in bytes, but it can be used for single-byte CLOBs only, so it will return the same result as LENGTH().
Unfortunately, Oracle can't perform minus operations on clobs.
I'm trying to combine the GROUP BY
function with a MAX in oracle. I read a lot of docs around, try to figure out how to format my request by Oracle always returns:
ORA-00979: "not a group by expression"
Here is my request:
SELECT A.T_ID, B.T, MAX(A.V)
FROM bdd.LOG A, bdd.T_B B
WHERE B.T_ID = A.T_ID
GROUP BY A.T_ID
HAVING MAX(A.V) < '1.00';
Any tips ?
EDIT It seems to got some tricky part with the datatype of my fields.
T_ID
is VARCHAR2
A.V
is VARCHAR2
B.T
is CLOB
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