Monday, 26 August 2013

Using sql query to print the result in a serialized format

Using sql query to print the result in a serialized format

I have a database table like this:
C1 C2 C3
---------------------
81 1 10
81 2 20
81 3 30
82 1 40
82 2 50
82 3 60
Note that it has no primary key.
I want to run a query which prints C1 and the various occurrences of C3
values with it. It basically gives me the output in a serialised format. I
mean something like this :
81 10 20 30
82 40 50 60
The one approach I can think of is using a rownum but am not sure if
that;s the way to go about it. Is there a better way for doing this ?

No comments:

Post a Comment