Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Need help writing SQL Query
I have two tables,
Table A (
TabAID number ColA varchar, ColB number
Table B (
TabBID number, TabAID number, ColX varchar, ColZ varchar
Table A Values:
TabAID ColA ColB
---------- ------- --------
1001 DHL 2000 1002 UPS 2500
Table B Values:
TabBID TabAID ColX ColZ ----------- ----------- -------- ------------ 5000 1001 Freight Charge 100 5001 1001 Max Weight 70 5002 1002 Freight Charge 100 5003 1002 Max Weight 55
ColX in Table B is really a column name and ColZ holds the value. Note,
that the values
in Table B will grow over time meaning more columns will be returned
Is there a way to write a query such that it returns a row like this in SQLPlus
ColA ColB "Freight Charge" "Weight"
------- ------- ---------------------------- ----------------- DHL 2000 100 70 UPS 2500 100 55
Esentially I need a cross-tab and some how merge that with a regular standard select
Thanks Received on Fri Jul 18 2003 - 22:38:12 CDT
![]() |
![]() |