I’m a newbie with Oracle. In SQLite, PostgreSQL or MSSQL I can do the following query:
SELECT * FROM users ORDER BY id, email
Here is the definition of USERS:
CREATE TABLE "USERS" (
"ID" NUMBER(38,0) NOT NULL,
"EMAIL" VARCHAR2(255)
)
Id is NUMBER type and email is VARCHAR type.
When I run the above SELECT query in Oracle it will raise the error:
ORA-00932: inconsistent datatypes: expected - got CLOB
Is there anyway to do that in Oracle?
Thank for your interest.
Seems like the
emailfield is aCLOBand not aVARCHAR. You cannotORDER BYaCLOB.If your column is a
CLOBthen you canCAST()the field to order by:See SQL Fiddle With Demo