Gossamer Forum
Home : General : Databases and SQL :

Help with syntax fixing in SQL

Quote Reply
Help with syntax fixing in SQL
following code gives the error message: "ORA-00979: not a GROUP BY expression", how do I fix this?

select ssn, category, min_units - sum(units) "UNITS_LEFT"
from course
where category = category
group by ssn

additional info:

table course: SSN SECTION UNITS COURSE CATEGORY MIN_UNITS
Quote Reply
Re: [KJones] Help with syntax fixing in SQL In reply to
Try this:

select ssn, category, min_units - sum(units) as UNITS_LEFT
from course
where category = category
group by ssn

TheStone

B.