posted 22 years ago
Hi,
I'm making a join involving 5 tables, all with primary and foreign keys. For example, if one table has a unique empno(for employee table),another table(vacation) has many values for that same empno depending on the number of vacations that empno has taken.The unique primary key for vacation is say vacationno. Now, when I make the join (which involves getting personal information etc), based on the empno, I get multiple rows with the same data in it for an empno with mutliple entries in vacation table. If I try to use distinct in my select statement,
I get an error saying :
ORA-00920: invalid relational operator
My question is, when I use distinct, does it hold good for only the first column immediately after it, or to all columns in the select statement ? And why am I getting the above error ? When I type the select statement without the distinct clause, it runs properly. With distinct, i get the error.
Is there a way to get the desired result, ie, only one row in vacation table for multiple empno values ? I want to use empno as my selective criteria.
Any suggestions will be very heplful.
Thanks.