Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> query help, please

query help, please

From: <iwei16_at_gmail.com>
Date: Sat, 11 Aug 2007 23:34:29 -0400
Message-ID: <d485a5280708112034m295f9e0ft5f51f6d6d03a0f7a@mail.gmail.com>


I have the following query:

select table_name, table_name_id, count(*) from approved_tables
group by table_name, table_name_id
order by count(*) desc

TABLE_NAME TABLE_NAME_ID COUNT(*)

----------------  -------------  -------------  -----------
eHA_Cont_P     1153600965418             5254
CSElent         1151606341446               5179
CSElent         1151606341460               5163
eHA_Cont_P     1151606276700             3808
Page              1155140051116              3805


The data in the TABLE_NAME column are the names of tables. I need to query the data for the TABLE_NAME column using TABLE_NAME_ as the FK
(for example: select name from eHA_Cont_P where id = 1153600965418;



xxx
)
and
need to see the output from the above query with the resulting "NAME" value.

So I need something like this:
TABLE_NAME TABLE_NAME_ID COUNT(*) NAME

----------------  -------------  -------------
-------------------------------------------
eHA_Cont_P     1153600965418             5254        XXX
CSElent         1151606341446               5179        YYY
CSElent         1151606341460               5163        ZZZ
eHA_Cont_P     1151606276700             3808        WWW
Page              1155140051116              3805        VVVV


How would I do that?

Please help.

Thanks.

--
http://www.freelists.org/webpage/oracle-l
Received on Sat Aug 11 2007 - 22:34:29 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US