Virtual table

Hello

When can I use aliases for tables? i.e.

Select xxx from table1, tab2 (yyy select from table2)
where xxxxxxxx

I mean can you explain the scenario where we use this tab2?

Thank you

Hello

user539616 wrote:
Franklin,

Thanks for the reply. I just gave an example. But my question was, he we a lot of select statements with a sql query instead of a table with complex name where clauses. I wanted to know what is the reason for the use of way if we can define where the conditions of the main SQL statement.

If we can define where conditions in the main SQL statement, then it is purely a matter of style if you want to use questioning or not.
Sometimes, it is more difficult to do everything in a single query.
It is sometimes impossible.
For example, the query Top - n below, which found three employees in each Department:

SELECT     *
FROM     (     -- Begin in-line view to compute r_num
     SELECT     ename
     ,     deptno
     ,     sal
     ,     RANK () OVER     ( PARTITION BY     deptno
                      ORDER BY     sal     DESC
                    )     AS r_num
     FROM     scott.emp
     )     -- End in-line view to compute r_num
WHERE     r_num     <= 3
ORDER BY     deptno
,          r_num;

Output:

ENAME          DEPTNO        SAL      R_NUM
---------- ---------- ---------- ----------
KING               10       5000          1
CLARK              10       2450          2
MILLER             10       1300          3
SCOTT              20       3000          1
FORD               20       3000          1
JONES              20       2975          3
BLAKE              30       2850          1
ALLEN              30       1600          2
TURNER             30       1500          3

How would you do that without a subquery?

Tags: Database

Similar Questions

  • Come selects (two or more) virtual Tables Possible?

    Hello.

    That's what I mean by a virtual table - and it works in OBIEE-
     select
        saw_0, saw_2, saw_3
     from
     (
         SELECT 
            "- Nx_CSDG0_Repair_Orders (Depot Repair Views)".Repair_Number saw_0, 
            "- Nx_CSDG0_Repair_Orders (Depot Repair Views)".Repair_Order_Creation_Date saw_2, 
            "- Nx_CSDG0_Repair_Orders (Depot Repair Views)".Repair_Order_Closed_Date saw_3 
    
         FROM
    
            "[Noetix-NoetixGlobalRepository] NoetixViews for Oracle Service"
    
         WHERE 
    
           "- Nx_CSDG0_Repair_Orders (Depot Repair Views)".Repair_Number BETWEEN '100000' AND '100009'
     ) t1
    However, this does not work-

    [Note that each of the nested queries works well on its own.]
     select
        saw_0, saw_2, saw_3, saw_4
     from
     (
         (SELECT 
            "- Nx_CSDG0_Repair_Orders (Depot Repair Views)".Repair_Number saw_0, 
            "- Nx_CSDG0_Repair_Orders (Depot Repair Views)".Repair_Order_Creation_Date saw_2, 
            "- Nx_CSDG0_Repair_Orders (Depot Repair Views)".Repair_Order_Closed_Date saw_3 
         FROM
            "[Noetix-NoetixGlobalRepository] NoetixViews for Oracle Service"
         WHERE 
            "- Nx_CSDG0_Repair_Orders (Depot Repair Views)".Repair_Number BETWEEN '100000' AND '100009' ) t1,
    
         (SELECT 
            TOPN("- Nx_CSDG0_Repair_Orders (Depot Repair Views)".Repair_Number, 3) saw_4,  
         FROM 
           "[Noetix-NoetixGlobalRepository] NoetixViews for Oracle Service" 
         WHERE 
           "- Nx_CSDG0_Repair_Orders (Depot Repair Views)".Repair_Number BETWEEN '100000' AND '100009' ) t2
    
     ) t3
    My question is this - y at - it a syntactic variation on what works? Or is it impossible?

    Thank you!

    Charlie

    Hi Charlie,

    Select this check box under query, I suggest you to make example which can help you to understand my approach.
    I used the quarter column because it is close to your condition, thereby, I see 4 times each files instead of 3 as in your example.

    SELECT A.saw_1, A.saw_2
    Of
    (SELECT
    Time. "" Saw_0 of the year. "
    Time.Quarter saw_1,
    'Sales' saw_2
    OF "SubjectArea.
    WHERE the time. "' Year ' = '2012'
    ORDER BY saw_0, saw_1) a RIGHT OUTER JOIN
    (SELECT time. "' Year ' saw_0, rcount (Time.Quarter) saw_1 OF THE time WHERE"SubjectArea. ("' Year ' = '2012') B
    ON (A.saw_0 = B.saw_0)

    For values of rehearsal go to the properties of the column-> column-> value remove Format-> repeat

    Hope this helps you.

  • Create virtual table.

    Hi all

    I have a table with the subtype, DATAID, ORIGNALDATAID, DATE column.

    Select dataid, orignaldataid table where subtype = 1 and the Date = August 1, 2010.

    I have the above query statement. I need the dataid for further processing, but before the treatment is done. I need to check if the orignaldataid = 0, if yes, dataid remains of another dataid = orginaldataid. Before the list was move to another sql. But I intend to use sql nested for futher treatment, so I need the database to crunch the data instead of using java to change the data.

    I was thinking creaating another table of virtaual in DB where it will automatically do this for me instead of having the column dataid and orginaldatid, it will juice dataid column. Then I can just query the virtual table.
    Select dataid from virtualTable where subtype = 1 and the Date = August 1, 2010. Is this possible?

    I have a few questions to ask, because I'm not clear on what to do:

    (1) of the virtual table, did you mean a temporary table or view Inline?

    (2) is it an inevitable necessity for you to create another table just for fun a column?

    (3) did you want a (kind-of-a-thing) wrapper around the original with the required columns table for java work on, in this case, a query online can be a good option similar to below:

    create or replace view vw_table
    is
    select (case when orignaldataid = 0 then dataid
                      else orignaldataid
              end) dataid
    from table
    where subtype=1 and Date=01-Aug-2010
    

    You can use the select query as-is as a subquery.

    HTH.

  • How to optimize the query with a join of virtual tables

    I'm working on a query that is get the data of virtual tables 2 and b
    one is formed by the Union, all say 4 queries and b is formed by the Union, all say 3 queries
    then these two virtual tables and b are joined on a column common and data are extracted from their part.
    Problem is that there is about 1 minutes each in the two virtual tables has and b. If individual a and b queries virtual takes about 5 seconds to retrieve data
    but the join on column takes about 25 seconds to retrieve data.
    Can someone guide me how to optimize the recovery of joining 2 virtual tables having large data

    Thank you

    Please read these:

    When your query takes too long
    When your query takes too long...

    How to post a SQL tuning request
    HOW to: Validate a query of SQL statement tuning - model showing

  • virtual table question

    Hello. I use the following query for groups of traction line with the same value of "Reporter". In the virtual (b) table below, I want to assign a sequential number to each group and then include this sequence number in the columns that I select at the top of the query.

    Select a.reporter, a.project_cd, active_ind, trunc (inact_dt) inact_dt, a.create_dt, substr(a.zip,1,5) zip5
    a journalist,
    (select journalist
    journalist of
    Journalist group
    view count (*) > 1
    b of the order by the reporter),
    where a.reporter = b.reporter;

    The following does not work, but it might give you an idea what I hope to accomplish:

    Select a.reporter, a.project_cd, active_ind, trunc (inact_dt) inact_dt, a.create_dt, substr(a.zip,1,5) zip5, B.SEQ_NUM
    a journalist,
    (select reporter, SEQ_NUM)
    journalist of
    Journalist group
    view count (*) > 1
    b of the order by the reporter),
    where a.reporter = b.reporter;

    Is something like this?
    select  a.reporter,
            a.project_cd,
            a.active_ind,
            trunc(a.inact_dt) inact_dt,
            a.create_dt,
            substr(a.zip,1,5) zip5,
            dense_rank() over(order by a.reporter) SEQ_NUM
      from  reporter a,
            (
             select  reporter
               from  reporter
               group by reporter
               having count(*) > 1
            ) b
      where a.reporter = b.reporter
      order by reporter;
    

    SY.

  • Need help with the merger of the lines of a virtual Table based on a foreign key

    The following is the result of the sample of a large SQL SELECT statement exits from a single table. I used - to show the values of X in each column

    CODE - XX - YY - ZZ_
    AD------------X-----------------------------------
    AD-----------------------------------------------X
    AD---------------------------X--------------------
    CD------------X-----------------------------------
    CD-----------------------------------------------X
    CD---------------------------X--------------------

    I would like to further clarify the results above by the merger on a single line for each CODE. Example below.

    Please note that each line for each code, has only a single value. Thus, by using a CONCAT function would be fine for me. I am at a loss to identify the parent SQL statement to merge data as below

    CODE - XX - YY - ZZ_
    AD - X - X - X
    CD - X - X - X

    Seek help from people on this forum

    Published by: cseshan on October 18, 2010 21:04

    Published by: cseshan on October 18, 2010 21:05

    Published by: cseshan on October 18, 2010 21:08

    Published by: cseshan on October 18, 2010 21:09

    Published by: cseshan on October 18, 2010 21:09

    Published by: cseshan on October 18, 2010 21:11

    also - if you put the [code] [/ code]
    Tags around your code (without spaces) you can format it slightly better

    By asking questions on the forum it is also good to add table creation/insert script or use a statement and other you should reproduce your data
    for example:

    SQL> with t as (select 'AD' code, 'X' xx, null yy, null zz from dual
      2              union all
      3             select 'AD',NULL,'X',NULL FROM DUAL
      4             UNION ALL
      5             SELECT 'AD',NULL,NULL,'X' FROM DUAL
      6             union all
      7             select 'CD' , 'X' , null , null  from dual
      8             union all
      9             select 'CD',NULL,'X',NULL FROM DUAL
     10             UNION ALL
     11             SELECT 'CD',NULL,NULL,'X' FROM DUAL)
     12  SELECT code, max(xx), max(yy),max(zz)
     13    from t
     14    group by code           ;
    
    CODE                             MAX(XX)                          MAX(YY)                          MAX(ZZ)
    -------------------------------- -------------------------------- -------------------------------- -
    AD                               X                                X                                X
    CD                               X                                X                                X
    
    2 rows selected.  
    
  • Table of DB tools list: how to access tables that are in the different SQL database?

    Hi all

    I work on an implementation of database (SQL server) and evaluates the Toolkit OR DB for this project.

    One of the requirements is that I need access to the tables that are in two different database

    (say Table to 1 DB and Table B to 2 DB).

    Our IT guy linked table in DB1 to DB 2 and I verfied this when I use the SQL server management studio.

    When DB 2 tables is filled, table from DB1 is also there. I can also do the same thing using MS Access.

    Table A of the DB1 is available for me enven if I only connect to 2 DB.

    Here comes the problem.

    When I use DB tool list Table.vi to access DB2, it does NOT list A table in DB1. It list only the tables in

    the database (DB2) which I am connection (using DB tool opened Connection.vi with a file DSN)

    So my work around right now is to open a separate connection both DB1 and DB2. However, this approach

    obviously creates a problem when I have to access a separate database constantly in my application.

    What would be a solution to this? I have search the Forum but only to see a post that is somewhat related to

    My question. (And it was published the 2004) Maybe I need to change the code in the orignial VI (DB tool list Table.vi)?

    My computer guy told me that he has not met this scenario since he wrote code in another environment such as

    VB and others and it has always been successful in linking the different database tables.

    I hope my question is clear and healthy because I don't really know much about database terminology.

    Any comment or suggestion is appreciated!

    Thank you

    Chad

    Ok.  Here is some information that I can work with.  Good.

    Your COMPUTER staff created a view called "VISUAL_WORK_ORDER".

    A view isn't a table.  It is a "virtual" table  Views are used to collect data (usually) in several different tables.

    But I guess that the code inside the DB tool list Table.vi returns a list of tables.  Views are not the tables.  Then "VISUAL_WORK_ORDER" does not appear in the list.

    HOWEVER, this should not really matter.  The view is here!  And it can be queried like any table.  So, you can use DB tools Select Data.VI... and wire in "VISUAL_WORK_ORDER" as the name of the table.  This will return the contents of the view.  Alto!

  • The external Table storage

    Since data is stored outdoors, and the definition that is stored inside, it means that a the table structure of the outer table is stored in the database as well (or a virtual table based on the definition of the external table...)

    I'll hit the ORA-DOCS again once, back in the external tables read tonight on them 2 or 3 sources and it is not quite clear whether real data with structure exists outside the database or an internal table set (and stored) retrieves data from an outside source.

    Since data is stored outdoors, and the definition that is stored inside, it means that a the table structure of the outer table is stored in the database as well (or a virtual table based on the definition of the external table...)

    The 'definition' you refer to IS the structure of the table; they are one and the same. There is no 'table' stored in the database using space or storage. When a query on an external table is executed, the data source is read.

    
    I'll be hitting the ORA-DOCS up again, just got back into external tables tonight reading up on them from 2-3 sources and it is not quite clear if an actual data with structure exists out of the database , or an internally defined (and stored?) table draws data from an outside source.
    

    I suggest you that start with the documentation of Oracle - including the ground provided the link to:

    If any "metadata" are stored outside the database depends on if the file that is outside of the database was produced by Oracle using the robot UNLOADING discussed in this doc

    Unloading of data using ORACLE_DATAPUMP Access driver

    To unload data, you use the ORACLE_DATAPUMP driver access. The stream that is discharged is in a proprietary format and contains all of the data column for each row being unloaded.

    A discharge operation also creates a stream of metadata that describes the content of the data stream. The information in the metadata stream are required to load the stream. Therefore, the metadata stream is written to the file data and placed before the data stream.

    If YOU provide data/files, then you MUST provide it in the format expected by the external table statement. You can, if you wish, use a preprocessor to convert ANY file (zip, encrypted, etc.) in the required format.

    For YOUR files, you can the metadata stored in the same file, or elsewhere, if you choose, but Oracle will have NO knowledge of this fact and not will NOT be involved in the transformation or read any of the metadata that you provide. Your preprocessor must remove all these metadata and ONLY provide data in the format appropriate for Oracle to use.

    If the file was produced by the process of UNLOADING Oracle then it will include metadata that Oracle WILL read, use, and remove as says this quote from doc above. These external metadata is added to the real external table definintion/metadata stored in the dictionary.

  • details of the virtual columns and deterministic function

    Hello

    First time that I post a question after the migration of the Forums. So please excuse me if you see errors in format.

    Below, I have created a function as deterministic and a table with a virtual column (column refers to the function)

    Here are my questions

    (1) if I run SELECT * FROM t whenever Oracle will perform the function add_fn?

    (2) what is the advantage of DETERMINISTIC? (Documentation says that if we declare a function as deterministic he will attempt to use previously caluculated results for the same set of values. So, when I ever I run SELECT * FROM t oracle executes add_fn only once and it will use the result for the next time. Is my understanding correct.)

    Here's the code.

    SQL> create or replace function add_fn ( p_n1 in number
      2                                                   ,p_n2 in number )
      3  return number deterministic
      4  is
      5  begin
      6      return p_n1+p_n2;
      7  end;
      8  /
    Function created
    SQL> create table t ( n1 number
      2                       ,n2 number
      3         ,n3 number generated always as (add_fn(n1,n2)) virtual
      4         );
    Table created
    SQL> insert into t (n1,n2) values (10,20);
    1 row inserted
    SQL> select * from t;
            N1         N2         N3
    ---------- ---------- ----------
            10         20         30
    SQL> select * from t;
            N1         N2         N3
    ---------- ---------- ----------
            10         20         30
    SQL>
    

    Hello

    ...
    (1) if I run SELECT * FROM t whenever Oracle will perform the function add_fn?

    (2) what is the advantage of DETERMINISTIC? (Documentation says that if we declare a function as deterministic he will attempt to use previously caluculated results for the same set of values. So, when I ever I run SELECT * FROM t oracle executes add_fn only once and it will use the result for the next time. Is my understanding correct.)

    ...

    (1) oracle will have to evaluate the function.  Because only deterministic functions are allowed, this means that it will not necessarily perform the function again; He can get the value cached from a previous call.

    I think that the indexed values are actually stored in the index.  "SELECT * FROM t;" do not use an index, but if you make another request, then you should be able to get the value of the virtual table of the index, without calling the function or obtaining the value of a cache.

    (2) If a function is DETERMINISTIC, the optimizer may decide whether to actually call the function each time, or the cache for better performance results.  There is no guarantee that it will always be one or the other.  Replace "will be" in your description "may", and then what you say is correct.

  • How to integrate the structures of different tables in different databases?

    Hello

    I am new to oracle... well help me with the below question...

    I have the same set of attributes linked together (a, b, c and d) in two different databases A and B.

    The structure of the tables at the same time the database are different, but they carry the same attributes in the same relationship.

    I have to integrate these attributes to object unique db such as any update to the base tables updates my object. How can I do this and what object will be useful?


    Thank you

    Hi Arun,

    Then as you say they are of different databases, we can create a link between the databases and
    can create view based on the Tables.

    (i.e.) if the data in the base table changes the data in the view should also change in real time.

    Arun, of course, the view will also change in real time, because the view is nothing more than a virtual table.

    When you query on a view, he questioned the details of the * "Base Table" * only. If the data will be updated, i.e.
    existing in the Base Table.

    Thank you
    Shankar

  • How to determine if a given entity is a table or a view

    Since the view is a "virtual" table, how to check if a 'table' name is in fact a view, or in fact a real table?

    The object view has a column OBJECT_TYPE

    select object_name from all_objects
    where owner = 'SCOTT'
    and object_type = 'VIEW'
    
    OBJECT_NAME
    V_EMP
    VIEW_EMP_TEST
    THREE_TABLE_EMP_VIEW
    TEST12
    

    And what you think, it's a TABLE or a VIEW might just be a SYNONYM.

  • Extraction of a node in an XMLtype table - selection of the previous query

    Hey all,.

    I work with a server Oracle 11 g r2 and basically need to be able to analyse and select nodes from it. I spent hours scouring the net and reading the manual oracle xml db trying to find an appropriate solution to my problem, but I can't seem to identify the correct way to do it. I have some experience in programming, but none with databases oracle, sql or xml in general so forgive me if this is a trivial question.

    OK, so the question:

    I have a very simple XML file saved under catalog.xml and it is as follows:

    <>Catalog
    < cd >
    < title > hide your heart < /title >
    < artist > Bonnie Tyler < / artist >
    < Country > UK < / country >
    < company > CBS Records < / company >
    < price > 9.90 < / price >
    < year > 1988 < / year >
    < CD >
    < cd >
    Empire Burlesque < title > < /title >
    < artist > Bob Dylan < / artist >
    < country > USA < / country >
    < company > Columbia < / company >
    < price > 10.90 < / price >
    < year > 1985 < / year >
    < CD >
    < / catalogue >

    Now, I want to be able to extract the title of the given cd a certain artist. So, for example, if the artist is "bob dylan", the title should be "empire burlesque".

    Now I created an XMLType table in Oracle as follows:

    CREATE BINARY XMLTYPE STORE AS XML BINARY XMLType TABLE.

    I then load my xml file into oracle by:

    Insert the BINARY values (XMLTYPE (BFILENAME ('XML_DIR', 'catalog.xml'), nls_charset_id ('AL32UTF8')));

    So far so good.

    Now for the part of the excerpt:

    First of all I've tried:

    SELECT extract (b.object_value, ' / catalogue/cd/title ')
    Binary b
    WHERE existsNode (b.object_value,'/catalog/cd [artist = "Bob Dylan"]') = 1;

    EXTRACT(B.OBJECT_VALUE,'/CATALOG/CD/TITLE')
    --------------------------------------------------------------------------------

    < title > hide your heart < /title >
    Burlesque Empire < title > < /title >

    1 selected line.



    It did not work because the xml file was all in 1 row then I realized that I had to split my xml in separate rows. Doing that, I had to convert the nodes < title > a virtual table using the functions XMLSequence() and table(). These functions convert nodes two title returned by the extract() function in a virtual table composed of two XMLType objects, each of which contains a single title element.

    Second test:

    SELECT value (d)
    Binary B,
    Table (xmlsequence(extract(b.object_value,'/catalog/cd'))) d
    WHERE existsNode (b.object_value,'/catalog/cd [artist = "Bob Dylan"]') = 1;

    VALUE (D)
    --------------------------------------------------------------------------------

    < cd >
    < title > hide your heart < /title >
    < artist > Bonnie Tyler < / artist >
    < Country > UK < / country >
    < company > CBS Records < / company >
    < price > 9.90 < / price >
    < year > 1988 < / year >
    < CD >

    < cd >
    Empire Burlesque < title > < /title >
    < artist > Bob Dylan < / artist >
    < country > USA < / country >
    < company > Columbia < / company >
    < price > 10.90 < / price >
    < year > 1985 < / year >
    < CD >

    2 selected lines.


    It's better because it is now divided into 2 different lines so I should be able to make a selection - where, and then select the title from the artist.

    However, this is where I have questions, I tried to literally hours but I can't understand how to use the results of the query above in my next. So I tried to use a suquery in this way:

    Select extract (sub1, ' cd/title')
    Of
    (
    SELECT value (d)
    Binary B,
    Table (xmlsequence(extract(b.object_value,'/catalog/cd'))) d
    ) sub1
    WHERE existsNode (sub1,'/ cd [artist = "Bob Dylan"]') = 1;

    However, sql * plus displays an error:

    ORA-00904: "SUB1": invalid identifier.

    I've tried dozens of variations to try to use subqueries but I simly can't do things.

    I heard you can do also do this using variables or pl/sql, but I don't know where to start.

    Any help would be greatly appreciated I tried everything at my disposal.

    This should help you get started!

    select banner as "Oracle version" from v$version where banner like 'Oracle%';
    
    create table otn5test(
      id number,
      data xmltype
    );
    
    insert into otn5test values (1, xmltype('
    
    Hide your heart
    Bonnie Tyler
    UK
    CBS Records
    9.90
    1988
    
    
    Empire Burlesque
    Bob Dylan
    USA
    Columbia
    10.90
    1985
    
    
    '));
    
    select otn5test.id, x.*
    from otn5test,
         xmltable('/catalog/cd[artist/text()="Bob Dylan"]' passing otn5test.data
         columns title varchar2(20) path 'title') x;
    
    select otn5test.id,
           xmlcast(xmlquery('/catalog/cd[artist/text()="Bob Dylan"]/title'
                   passing otn5test.data returning content)
           as varchar2(20)) from otn5test;
    
    drop table otn5test;
    
    sqlplus> @otn-5.sql
    
    Oracle version
    ------------------------------------------------------------------------------
    Oracle Database 11g Release 11.2.0.1.0 - 64bit Production
    
    Table created.
    
    1 row created.
    
         ID TITLE
    ---------- --------------------
          1 Empire Burlesque
    
         ID XMLCAST(XMLQUERY('/C
    ---------- --------------------
          1 Empire Burlesque
    
    Table dropped.
    
  • PLSQL block return table

    Hi is possible for a pl/sql block return a table?

    DECLARE
    CURSOR c1 is
    Select * from phg_well;
    BEGIN
    OPEN c1;
    for r in c1 LOOP
    Add to a virtual table
    end loop;
    return virtual table
    Close c1;
    end;
    /

    Again, I suggest to use PL/SQL table, where you can refer a file with a number. Using the cursor, you can not refer to the backrest. You must go forward. But if you collect the record in the table located in a set, you can work on documents in both directions.

    If post you some examples of data, I can give you a better example on it.

  • compare amounts of two separate tables to each other.

    I have two tables
     table pants
    
    id amt
    1 50
    1 50
    1 50
    
    
    table jacket
    
    id amt
    1  50
    1  50
    1  50
    
    when i do a select  of say 
    
    
    SELECT  a.id, b.id   SUM(a.amt),sum(b.amt) from pants a, jacket b WHERE A.ID = B.ID group by a.id, b.id 
    
    
    /* i get a really awkaward result i can't understand what im doing wrong*/
    I would get a single line with the result set


    an a.mt b b.amt
    1 1 150 150


    but instead my amount in duplicate like 3 or four times. like the 450 and 450?
    I tried to use SEPARATE on the sql, but I got no where can someone throw me a BONE here.
    Thanks in advance.

    That's what you want...

    sudhakar@ORCL>-- Sample data in virtual tables
    sudhakar@ORCL>with pants as
      2  (select 1 id, 50 amt from dual union all
      3  select 1 id, 50 amt from dual union all
      4  select 1 id, 50 amt from dual)
      5  ,jacket as
      6  (select 1 id, 50 amt from dual union all
      7  select 1 id, 50 amt from dual union all
      8  select 1 id, 50 amt from dual)
      9  -- Actual QUERY
     10  select aid, bid, aamt, bamt
     11  from
     12  (SELECT  a.id aid,   SUM(a.amt) aamt from pants a group by a.id) pants_summary
     13  inner join
     14  (SELECT  b.id bid,   sum(b.amt) bamt from  jacket b group by  b.id ) jacket_summary
     15   on( pants_summary.aid = jacket_summary.bid)
     16   ;
    
           AID        BID       AAMT       BAMT
    ---------- ---------- ---------- ----------
             1          1        150        150
    
    sudhakar@ORCL>
    

    pre
    Sudhakar B.

  • Tables Sql PL...

    Hi friends,


    Is it possible to join the PL/SQL tables as join noramal, we use with tables in the actual database.


    For example. < normal join we use in the database >


    Select a.col, b.col1
    of table a, table 1 b
    where a.x = b.x;

    ===========
    can us capable of doing this is plsql program using plsql tables instead of actual tables?
    ===========


    Declare

    type tab_1 is table of the table % rowtype;
    type tab_2 is the table table1% rowtype;
    v_tab tab_1;
    v_tab1 tab_2;

    Begin

    Select * bulk collect into v_tab
    table;

    Select * bulk collect into v_tab2
    FROM table1;


    NOW, I should LIKE to JOIN tab_1 AND AND GET SOME DETAILS tab_2
    Select a.col, b.col1
    of v_tab, v_tab1 b
    where a.x = b.x?

    end;


    is this possible? Join virtual tables like real tables...

    Thank you.
    -reda

    Published by: user780731 on April 30, 2009 02:50

    Published by: user780731 on April 30, 2009 02:59

    Published by: user780731 on April 30, 2009 03:05

    (i) in parentheses,
    (II) cast unknown type

    Two of them were minor syntax errors that eb able to fix it yourself, you should
    It works

    declare
    ltbl tbl_1 := tbl_1(1,2,3,4,5);
    begin
    for i in (select * from table(cast(ltbl as tbl_1)))
    loop
    dbms_output.put_line(i.column_value);
    end loop;
    end;
    

Maybe you are looking for

  • Why the Web page after only the third Center of the screen and not the whole width?

    Using firefox on a vaio z 13.0.1. All the websites I try to access to appear narrow, occupying only the third Center of the screen. Not such a problem with IE.

  • HP 19-2113w: the request by e-mail to technical call

    I had a technical support call which was very important. I had been scammed. I called to ask them to send me an email of the summary of this call. The person said she would, but did not. I need for my folder. Anyone know who I can call, who cares? Th

  • BlackBerry Smartphones SMS text - pending

    None of my sms texts will be turned off, will go just in a mode "on hold". I can receive texts, make/receive calls and make/receive emails. Someone knows how to fix this?

  • Get Adobe Bridge

    HelloIs it possible to download Bridge on its own? If this is not the case, what packages come with? I looked at the package of the photograph, but it seems that it does not come with it.I have a MacBook Pro.Thank you very much.

  • JSAFE_InvalidUseException using t3s

    Hi, I configured my weblogic to use t3s. Now, I'm getting JSAFE_InvalidUseException. Any idea that jar I'm missing? Please share the location of the jar as well.Exception: java.lang.NoClassDefFoundError: com/rsa/jsafe/JSAFE_InvalidUseException      [