简体   繁体   中英

Upper Case in Oracle sql

I am trying to create a view with Majors and Minors w/ upper case, but Oracle keeps giving me an error. What am I doing wrong?

CREATE VIEW A5T4 AS

SELECT StudentID, Major1, Major2, Minor

FROM A5

WHERE UPPER(Major1, Major2, Minor)

ORDER BY StudentID;

The error is: Error report - SQL Error: ORA-00909: invalid number of arguments 00909. 00000 - "invalid number of arguments" *Cause:
*Action:

The error is in the where clause. If you want your fields with upper case, use the function in the SELECT clause, not in the WHERE clause.

Try this :

CREATE VIEW 
   A5T4 
AS
SELECT 
   UPPER(StudentID) AS "StudentID", 
   UPPER(Major1) AS "Major1", 
   UPPER(Major2) AS "Major2", 
   UPPER(Minor) AS "Minor"
FROM 
   A5
ORDER BY 
   UPPER(StudentID);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM