Home » SQL & PL/SQL » SQL & PL/SQL » Query to build cursor in particular order
Query to build cursor in particular order [message #218504] Thu, 08 February 2007 08:22 Go to next message
drew_r
Messages: 1
Registered: February 2007
Junior Member
I need to write a query to sort the records in a particular order,

Say if I group the records by Dept number
Dept no Name
10 A
10 G
10 f

20 B
20 K

30 I
30 M
30 R
30 Y

I need to write a query that will make this records listed like

Dept No Name
10 A
20 B
30 I

10 G
20 K
30 M

10 F
20 null
30 R

10 null
20 null
30 Y


Drew
Re: Query to build cursor in particular order [message #218513 is a reply to message #218504] Thu, 08 February 2007 09:03 Go to previous message
tkstock
Messages: 28
Registered: April 2006
Location: Richmond
Junior Member
Sounds like the database needs to be normalized. What your saying is that Dept Number doesn't map to one Dept Name? What's your primary key? What else is in the table? It sounds like you're trying to patch a dam leak with bubble gum IMHO.
Previous Topic: ref cursor
Next Topic: remove duplicates in a query
Goto Forum:
  


Current Time: Sat Dec 10 12:33:13 CST 2016

Total time taken to generate the page: 0.09221 seconds