View previous topic :: View next topic |
Author |
Message |
Kris Beginner
Joined: 27 May 2006 Posts: 14 Topics: 7
|
Posted: Fri Mar 14, 2008 9:12 am Post subject: Data Fetching From Table |
|
|
Hi,
I need help in fetching the data from the table.
My table looks like this.
Code: |
USER PRODUCT
----------------------
USER1 PRODUCTA
USER1 PRODUCTB
USER1 PRODUCTC
USER2 PRODUCTA
USER2 PRODUCTD
USER2 PRODUCTE
..
|
This table holds the users and products they can access.
Now my requirement is to produce a report of all the users & products they can access.
My report should be in the form of
Code: |
USER1 PRODUCTA PRODUCTB PRODUCTC
USER2 PRODUCTA PRODUCTD PRODUCTE
|
I got around 30,000 users,each having more than 40 products.
Can i write any query to produce output in the above format
or advice me any tool i can use.
Thanks!! |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Fri Mar 14, 2008 10:17 am Post subject: |
|
|
Kris,
What version of Db2 are you running? if you are DB2 V9 then look up the RANK function _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
Kris Beginner
Joined: 27 May 2006 Posts: 14 Topics: 7
|
Posted: Fri Mar 14, 2008 1:10 pm Post subject: |
|
|
Kolusu,
We are using DB2V8 |
|
Back to top |
|
|
vjkumk Beginner
Joined: 28 Sep 2005 Posts: 98 Topics: 33
|
Posted: Wed Mar 26, 2008 10:28 pm Post subject: |
|
|
One way of getting the solution is,unload the table contents using a query to a flat file and use icetool and splice and use column one as key to get the format as you have mentioned.
Cheers,
vj |
|
Back to top |
|
|
edkir98 Beginner
Joined: 27 Aug 2007 Posts: 102 Topics: 42 Location: Chennai
|
Posted: Fri Mar 28, 2008 10:37 am Post subject: |
|
|
Hi Kolusu,
We are using DB2 V9. How is that possible using the RANK Function? _________________ Thanks |
|
Back to top |
|
|
|
|