Re: select * from (select * from bob) and other easy stuff
Posted in 2006
It seems you have some sort of 'unconventional' db design on your
hands.
Best of luck.
internetuser wrote:
> At any rate, I devised a working solution. Now I just wonder if there
> is a better way to do it, or if there is a more database-agnostic way
> of doing it. Here is what I've got now:
>
> /*VIEW: refill_all_entlmnt_types */
> create view refill_all_entlmnt_types (et_code,et_text,ct_code,ct_text)> as
> SELECT et_code,et_text,valid_case_type_code
> ct_code,valid_case_type_desc_txt ct_text
> FROM TABLE(
> MULTISET(
> SELECT
> et.entlmnt_type_code et_code,et.entlmnt_type_desc_txt et_text,
> decode (entlmnt_type_code,
> '12A','265101','12B','265102','12C','265200',
> 'IL-SS','265202','POOL','265204','12CH8','265208',
> 'IL-S','265211','14H1','265301','14H2','265302',
> '14H3','265303','14H5','265306','14H8','265308',
> '14H6','265311','UGRT','262720','CGNF','262712',
> 'CGPD','262711','MH','262710','SCHL','262714',
> 'GPGT','262730','TNCGT','262713') as ct_code
> FROM notrust@ak0779_gcdb:akinfrmx.entitlement_type et)
> ),OUTER(notrust@ak0779_gcdb:akinfrmx.valid_case_type vct)
> WHERE ct_code = valid_case_type_code> ;/*END OF VIEW DEFINITION*/
>
> p.s.: I thought I posted this once but it didn't look like it "took" -
> sorry if it gets duplicated.