Home » SQL & PL/SQL » SQL & PL/SQL » Query
Query [message #335952] Thu, 24 July 2008 04:26 Go to next message
nadine_a
Messages: 5
Registered: June 2008
Junior Member
hi

i have a table called course and another table called teacher. for every course (record), i have many teachers entered by order of importance. i.e the first teacher in the table teacher is the most important one.
i want to do a query that retrieves for every course the most important teacher. i.e for every record in table course, the top corresponding record in the table teacher. is it doable??

thank you.
Re: Query [message #335955 is a reply to message #335952] Thu, 24 July 2008 04:50 Go to previous messageGo to next message
nadine_a
Messages: 5
Registered: June 2008
Junior Member
I GOT MY ANSWER.
I USED ROWNUM = 1 AND USED GROUP BY
THANK YOU.
Re: Query [message #335976 is a reply to message #335955] Thu, 24 July 2008 05:14 Go to previous message
Michel Cadot
Messages: 64139
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Don't post in UPPER case.

Post your query, it is likely you use the wrong way, investigate ROW_NUMBER, RANK and DENSE_RANK functions.

Regards
Michel
Previous Topic: Invalid Objects
Next Topic: Retrieving Data which is in sequence
Goto Forum:
  


Current Time: Thu Dec 08 10:05:23 CST 2016

Total time taken to generate the page: 0.11032 seconds