Please help me in corelated subquery

Hi ,
Please help me to correct this query
update remsi.evs_invoice_header a
set INH_PROCESS_STATUS = 'REJECT'
,INH_PROCESS_COMMENT = to_char(nvl(inh_process_comment,'|'))||'INVALID INH_TOT_INVOICE_AMOUNT|'
where INH_TOT_INVOICE_AMOUNT > (
select TOT_PO_AMT - TOT_INV_AMT from (select sum(REQ_TOTAL_AMT) TOT_PO_AMT
from (
select req_total_amt from
citi.requisition
where req_change_req= 'N'
and req_req_no = a.INH_REMS_REQUISITION_NUMBER
and req_big_status_id=164383
union
select req_total_amt
from citi.requisition
where req_change_req ='Y'
and req_parent_id = to_number(a.INH_REMS_REQUISITION_NUMBER)
and req_big_status_id=164383
(select nvl(sum(nvl(INVPO_AMOUNT_APPLIED,0)),0) TOT_INV_AMT
from ( select nvl(invpo_amount_applied,0) invpo_amount_applied
from citi.invoice_po, citi.requisition
where invpo_po_id = req_po_id
and req_change_req= 'N'
and req_req_no = a.inh_rems_requisition_number
and req_big_status_id = 164383
union
select nvl(invpo_amount_applied,0) invpo_amount_applied
from citi.invoice_po , citi.requisition
where invpo_po_id = req_po_id
and req_change_req ='Y'
and req_parent_id = to_number(a.inh_rems_requisition_number)
and req_big_status_id=164383
AND INH_VENDOR_INVOICE_TYPE = 'PROJECTS';

I see what is wrong...
SQL> update remsi.evs_invoice_header a
  2  set INH_PROCESS_STATUS = 'REJECT'
  3  /
update remsi.evs_invoice_header a
ERROR at line 1:
ORA-00942: table or view does not existI don't have your tables, nor your schema...:)
seriously, just posting a query and say "correct this" without other information...
What's wrong with it? What do your tables look like? What is your db version? what is the requirement?... etc. etc. etc...
post as much detail as you can.

Similar Messages

  • Error Only one expression can be specified in the expression list when the subquery is not intriduced. Please help

    Please help to fix this error
    SELECT    A.FLEETID,
    (SELECT   b.fleetid,SIZE,MAKE,PATTERN FROM ROQFLEETCHECK B
             WHERE  B.AxleNo=1  and B.AxleType = 'OFFSIDE OUTER' AND B.FLEETID = 1819 and B.fleetid =  A.fleetid) AS fleetList
    FROM ROQFLEETCHECK    AS A WHERE  a.FLEETID = 1819;
    Regards
    Pol
    polachan

    Hi,
    In addition to
    Naarasimha's answer. a small clarification: As much as the query optimizer the sub query "SELECT...
    FROM ROQFLEETCHECK B WHERE  ..."  might return more then one value and therefore it raise this error. What you can do, is limit
    the returned value to one, using "top 1" or aggregate function (as
    Naarasimha suggested).
      Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]

  • Please help: How to pass variable from main select to subquery

    I have a table with four columns (id, status, start_date and end_date) as follows. What I want is to get the difference between the statuses' start_date to find out how long it takes for the ID to change status. Basically getting the difference of the Start_dates of the statuses for the ID.
    ID         Status               Start_date          End_date
    1         NEW             02-FEB-07        02-FEB-07
    1         OLD             04-FEB-07        06-FEB-07
    1         BAD             09-FEB-07        14-FEB-07
    I had initially thought of doing this
    SELECT ID, (SELECT Start_date from tbl where Status = 'OLD' and ID = 1) - (SELECT Start_date from tbl WHERE Status = 'NEW' and ID =1) from tbl where ID = 1
    but that would not work since I have more than one id and implementing inside Java will be complicated. Please help me what I need to do .. Thank you

    Or this:
    SQL> CREATE TABLE t AS (SELECT 1 ID , 'NEW' status, '02-FEB-07' start_date, '02-FEB-07' end_date FROM DUAL
    UNION ALL SELECT 1 ID , 'OLD' status, '04-FEB-07' start_date, '06-FEB-07' end_date FROM DUAL
    UNION ALL SELECT 1 ID , 'BAD' status, '09-FEB-07' start_date, '14-FEB-07' end_date FROM DUAL
    UNION ALL SELECT 2 ID , 'NEW' status, '02-FEB-07' start_date, '02-FEB-07' end_date FROM DUAL
    UNION ALL SELECT 2 ID , 'BAD' status, '05-FEB-07' start_date, '10-FEB-07' end_date FROM DUAL
    UNION ALL SELECT 2 ID , 'OLD' status, '07-FEB-07' start_date, '10-FEB-07' end_date FROM DUAL
    Table created.
    SQL> ALTER SESSION SET nls_date_format='DD-MON-RR'
    Session altered.
    SQL> SELECT ID,
           status,
           start_date,
           TO_DATE (start_date)
           - LAG (TO_DATE (start_date)) OVER (PARTITION BY ID ORDER BY TO_DATE
                                                                       (start_date))
                                                               diff_of_start_days
      FROM t
                                                    ID STA START_DAT                                 DIFF_OF_START_DAYS
                                                     1 NEW 02-FEB-07                                                  
                                                     1 OLD 04-FEB-07                                                  2
                                                     1 BAD 09-FEB-07                                                  5
                                                     2 NEW 02-FEB-07                                                  
                                                     2 BAD 05-FEB-07                                                  3
                                                     2 OLD 07-FEB-07                                                  2
    6 rows selected.

  • Need Help in creating a subquery using JOIN operation

    Hi,
    I am new to SQL and trying to write a query. Please help me in this.
    The Database Schema looks like this:
    The database scheme consists of four tables:
    Product(maker, model, type)
    PC(code, model, speed, ram, hd, cd, price)
    Laptop(code, model, speed, ram, hd, screen, price)
    Printer(code, model, color, type, price)
    The table "Product" includes information about the maker, model number, and type ('PC', 'Laptop', or 'Printer'). It is assumed that model numbers in the Product table are unique for all the makers and product types. Each PC uniquely specifying by a code in the table "PC" is characterized by model (foreign key referencing to Product table), speed (of the processor in MHz), total amount of RAM - ram (in Mb), hard disk drive capacity - hd (in Gb), CD ROM speed - cd (for example, '4x'), and the price. The table "Laptop" is similar to that one of PCs except for the CD ROM speed, which is replaced by the screen size - screen (in inches). For each printer in the table "Printer" it is told whether the printer is color or not (color attribute is 'y' for color printers; otherwise it is 'n'), printer type (laser, jet, or matrix), and the price.
    Alternatively you can refer here for the schema (Computer Firm)
    http://www.sql-ex.ru/help/select13.php#db_1
    Now my query is :
    Find the makers of the cheapest color printers.
    Result set: maker, price.
    and I have written the query as:
    SELECT prod.maker, prin.* FROM (SELECT MIN(price) AS price FROM printer WHERE color = 'y') AS prin INNER JOIN (SELECT maker, model FROM product) AS prod ON prin.model = prod.model
    Which is giving the error "Invalid column name 'model'.". Please help!
    Thanks!
    Faaz

    Hello,
    Your query does not work because your subquery prin does not return a column named model.
    Analytical functions like Vivek L suggests are the best way to do this, but this one is a correction of your query and should work too (not tested, unfortunately).
    SELECT prod.maker, prin2.*
    FROM  (SELECT MIN(price) AS min_price FROM printer WHERE color = 'y') AS prin
    INNER JOIN (SELECT model, price FROM printer WHERE color='y' ) AS prin2  ON prin.min_price = prin2.price
    INNER JOIN (SELECT maker, model FROM product) AS prod ON prin2.model = prod.model;Regards,
    Sylvie

  • CS5 Photoshop crashes... Have tried everything! Please help!!!

    Hi Guys! I am having big problems. I cannot use Adobe Photoshop (CS5) ....(nor Corel Paintshop Photo Pro x3 "Sorry for mentioning that on here!!! )
    I am running a 1 month old Toshiba Satellite C660-1F1 with Windows 7 Home Premium 64-bit with 2GB RAM Intel Core i3-380m processors 2.53 Ghz / 3rd Level Cache 3MB, 320 GB Hard Disk with Intel Graphics Media Accelerator HD (shared memory up to 761 MB).
    I have tried the full paid-for version and the trial version downloaded from the Adobe site.
    Both programmes (CS5 and Corel PSPx3) installed and can be opened.
    With photoshop when i open it the following message comes up:
           "Photoshop has encountered a problem with the display driver, and has temporarily disabled GPU enhancements. Check the video card manufacturer's website for the latest software. GPU enhancements can be enabled in the performance panel of preferences."
    I can usually perform one or two actions before the programme crashes and a message appears to say that it has stopped working. It will crash straight away if I click on the 'Help' menu and then on 'System Info'. Before it crashes when the buttonbs are still responsive ...if I go to the performance panel in preferences and scroll over 'detected video card' the discription box says:
           "Your system display driver has caused Photoshop to crash. Update or reinstall the driverand check enable OpenGL drawing to retry."
    When I follow these steps it just crashes as usual. I have deleted and reinstalled the drivers.I have deleted and reinstalled the programmes countless times. My drivers are all up-to-date. Both software packages claim to and seem to support 64-bit operating systems with my specs. Both say they support Intel HD Graphics. I do not know what else to do or try. I have even performed a fresh reinstallation of my windows 7 64-bit op system. I was looking to upgrade to 4 GB RAM and then  8GB RAM later but not before i can solve this problem.
    Is there something simple/obvious I am missing or is it most likely faulty hardware / bad graphics card??? Please help!
    Just in case it is relevant .... with Corel Paintshop Photo Pro x3 it installed and opens as usual but will crash the second you try to save something.The cursor remains normal but no buttons, tabs or menus are responsive at all. There is just a ping sound every time I click the mouse / touchpad. i must then use 'end task' in task manager to close it down, although it says the programme is running! (It does not say 'not responding').
    All info / advice / suggestions welcome!!! Thanking you in advance!
    John

    Intel doesn't have the best OpenGL implementation.  Okay, that may be being overly kind.
    Your best bet, especially if you have already loaded their latest driver, is probably to deconfigure OpenGL usage by Photoshop.
    First, try this:
    1.  Edit - Preferences - Performance
    2,  Click the [Advanced Settings...] button
    3.  Set Mode to Basic.
    4.  Uncheck Vertical Sync.
    5.  Close and reopen Photoshop.
    If this still doesn't help, try this:
    1.  Edit - Preferences - Performance.
    2.  Uncheck [ ] Enable OpenGL Drawing.
    3.  Close and reopen Photoshop.
    Good luck.
    -Noel

  • Grouping Inner Query based on a column.Please help

    I have a strange query.
    I am using Subquery to display the count of rows from the inner query
    depending upon the value of 'Y' or 'N'
    Trade
    id_entity       id_inst_code_type   id_inst_code   dt_trade
    AGL            SE                  5660249        10-Feb-06
    AGL            SE                  5660249        13-Feb-06
    AGL            SE                  5660249        13-Feb'06
    Instrument_xref
    ID_inst      id_inst_xref_type     id_inst_xref  flg_active
    0029010             SE          5660249          Y
    0070789          SE          5660249          Y
    0071190          SE          5660249          Y
    0072385          SE          5660249          Y
    0073215          SE          5660249          Y
    0084797          SE          5660249          Y
    0091375          SE          5660249          Y
    0094690          SE          5660249          Y
    0104438          SE          5660249          Y
    My output:
    id_inst_code_type          id_inst_code   Earliest    Latest       Total    Active
    SE                         5660249       10 Feb 06   13 Feb 06    3        9
    2) If all the 'flg_active' column in Table Instrument_xref is set to 'N'
       the Active should be 0.
    3) Assume that the flg_active could be 3 Y's and 6 N's then what?
    id_inst_code_type          id_inst_code   Earliest    Latest       Total    Active
    SE                         5660249       10 Feb 06   13 Feb 06    3        0
    How do I check for the 'Y' or 'N' value in my code below ?
    Help appreciated as the the functionality changes by the hour...
    select    tie.id_entity             'Entity',
              tie.id_inst_code          'Inst Code',
              min(tie.dt_trade)         'Earliest',
              max(tie.dt_trade)         'Latest',
              count(*)                  'Total',
              dt.InnerTotal             'Active'   
    from     trade_input_event tie,
    (Select  insx.id_inst_xref_type,
                   insx.id_inst_xref,
                   insx.flg_active,
                   count(*) InnerTotal
      from instrument_xref insx
      where insx.id_inst_xref = '5660249'
      ---** Do I need to Check the flg_active here..
      ---** Do I need to use the Having clause here? ie having count(insx.id_inst_xref) = 'N'
       group by insx.id_inst_xref_type,insx.id_inst_xref,insx.flg_active) dt
      where tie.id_inst_code = dt.id_inst_xref
      and tie.id_entity = 'AGL'
      group by tie.id_entity, tie.id_inst_code_type,tie.id_inst_code

    As the flg_active is set to 'Y', I am trying to set it to 'N' in the query
    so that count of 0 is returned, but this displays nothing.
    Please help as to how to display a count(*) of 0 when the flg_active is 'N'??
    Select  insx.id_inst_xref_type,
                   insx.id_inst_xref,
                   insx.flg_active,
                   count(*) InnerTotal
      from instrument_xref insx
      where insx.id_inst_xref = '5660249'
      and insx.flg_active = 'N'
      group by insx.id_inst_xref_type,insx.id_inst_xref,insx.flg_active) dt

  • Please help me out with some fundamentals in BW

    Hello,
    Please guide me regarding the below mentioned questions.
    1. what is the key date in query designer.
    2. when do we perform attribute change run
        like once the master data is loaded then we perform attribute change run and load the transactional data ?
    3.what is the disadvantage of using aggregates.
    4. what is full repair options?
    please help me out with these questions

    HI,
    Repair full request :
    If you indicate a request in full update mode as a repair request, then it is able to be updated in all data targets. This is also true if they already contain data from initial runs or deltas for this DataSource / source system combination, and they have overlapping selections.
    Consequently, a repair request can be updated at any time without checking each ODS object. The system supports loading in an ODS object by using the repair request without having to check the data for overlapping or request sequencing. This is because you can also delete selectively without checking an ODS object.
    Posting such requests can lead to duplicate data records in the data target.
    Hierarchy/attribute change run after loading master data;
    When hierarchies or attributes of characteristics change, the aggregate affected by the change can be adjusted manually or calculated automatically in process chains.
    Aggregates:
    Aggregates are materialized, pre-aggregated views on InfoCube fact table data. They are independent structures where summary data is stored within separate transparent InfoCubes. The purpose of aggregates is purely to accelerate the response time of queries by reducing the amount of data that must be read in the database for a given query navigation step. In the best case, the records presented in the report will exactly match the records that were read from the database.
    Aggregates can only be defined on basic InfoCubes for dimension characteristics, navigational attributes (time-dependent and time-independent) and on hierarchy levels (for time-dependent and time-independent hierarchy structures). Aggregates may not be created on ODS objects, MultiProviders or Remote Cubes.
    Queries may be automatically split up into several subqueries, e.g for individual restricted key figures (restricted key figures sales 2001 and sales 2002). Each subquery can use one aggregate; hence, one query can involve several aggregates.
    If an aggregate has less than 15 components, BW 3.x puts each component automatically into a separate dimension that will be marked as “line item” (except package and unit dimension); these aggregates are called flat aggregates. Hence, dimension tables are omitted and SID tables referenced directly.  Flat aggregates can be rolled up on the DB server (i.e., without loading data into the application server). This accelerates the roll up (hence the upload) process.
    Disadvantage : The more aggregates exist, the more time-consuming is the roll-up process and thus the data loading process; the change run is also affected.
    Hope this info Helps.
    Thanks,Ramoji.

  • Please help with some query

    hello all!
    please, help me again.
    we have a foreign key discrepancy and my task is to create a view which will show the 3 aspects.
    Let's we have 3 schemas: A - good (which means that i will compare WITH A, source)
    B and C are bad (which mean that I will checking this schemas).
    So, i need to obtain:
    1) FK that DO NOT exist in B&C and do exist in A
    2) FK that DO exist in bad schemas (B&C) but DO NOT exist in good schema (A)
    3) FK's that exist in both (A&B, A&C) schemas on the SAME TABLE, have THE SAME CONSTRAINT_NAME but are on the DIFFERENT columns.
    the first and second I seem to be done through the
    select CONSTRAINT_NAME, TABLE_NAME, STATUS from dba_constraints where owner='PRIV_MD' and CONSTRAINT_TYPE='R' and CONSTRAINT_NAME
    2 NOT IN (select CONSTRAINT_NAME from dba_constraints where owner ='MSA_MD'); (to get the second task we just reversing owners in query and subquery)
    query. but the third one is really pain in my back. i have a query:
    SELECT a.column_name, b.column_name FROM dba_cons_columns a, dba_cons_columns b, dba_constraints c, dba_constraints d
    WHERE c.CONSTRAINT_TYPE='R'
    AND a.CONSTRAINT_NAME = b.CONSTRAINT_NAME
    AND a.CONSTRAINT_NAME = c.CONSTRAINT_NAME
    AND b.CONSTRAINT_NAME = d.CONSTRAINT_NAME
    AND a.owner = 'PRIV_MD' AND b.owner = 'MSA_MD';
    which runs hours and returns million of rows with the two columns with the same names... but if i'm adding
    AND a.column_name != a.column_name (i'm not sure it's a correct syntax)
    line it returns "no rows selected"
    please, help me obtain it, i'm fighting already the second day..
    (please, don't be angry, i'm just learning and this is my first task on my work...)

    This is basically just a UNION ALL (the constraint columns from both schemas)
    MINUS what exists in both (the INTERSECTion)
    I made it a little more complicated so you could see in which schema the column is used. You could use exactly the same approach for your questions 1 and 2 also.
    SELECT * FROM
    (SELECT a.column_name,c.constraint_name,'salive' schema_containing
    FROM dba_cons_columns a
    INNER JOIN dba_constraints c ON a.CONSTRAINT_NAME = c.CONSTRAINT_NAME
    WHERE a.owner = 'SALIVE' and c.constraint_type = 'R'
    UNION ALL
    select b.column_name,d.constraint_name,'satest'
    FROM dba_cons_columns b
    INNER JOIN dba_constraints d ON b.CONSTRAINT_NAME = d.CONSTRAINT_NAME
    WHERE d.CONSTRAINT_TYPE='R' AND b.owner = 'SATEST') u
    WHERE NOT EXISTS
    (SELECT *
    FROM
    (SELECT a.column_name,c.constraint_name
    FROM dba_cons_columns a
    INNER JOIN dba_constraints c ON a.CONSTRAINT_NAME = c.CONSTRAINT_NAME
    WHERE a.owner = 'SALIVE' and c.constraint_type = 'R'
    INTERSECT
    select b.column_name,d.constraint_name
    FROM dba_cons_columns b
    INNER JOIN dba_constraints d ON b.CONSTRAINT_NAME = d.CONSTRAINT_NAME
    WHERE d.CONSTRAINT_TYPE='R' AND b.owner = 'SATEST') i
    WHERE u.column_name = i.column_name and u.constraint_name = i.constraint_name)

  • Help regarding Materialized view ( subquery expression not allowed here )

    Hi all,
    while creating materialized view i got following error
    ORA- 22818
    subquery expression not allowed here
    following is my query
    CREATE  MATERIALIZED VIEW MV_NAV_REC
    BUILD IMMEDIATE
    REFRESH COMPLETE ON DEMAND
    as
    select folio_no FOLIONO,CHKDIGIT as Check_Digit,sch_code SCHEMECODE, sysdate as FOLIODATE ,
         (select case when count(distinct SUBBROKERCODE) =1 then to_char(max(SUBBROKERCODE)) else 'Multiple Broker' end   from transaction_st
         where folio_no = tst.folio_no
         group by  folio_no)  ARN_Number ,
         (select sum(case when tran_type in ('PURCHASE','SWITCH IN') then UNITS else 0 - UNITS end ) from transaction_st
         where folio_no = tst.folio_no AND SCH_CODE = tst.sch_code
         group by  folio_no,sch_code)  NUM_UNITS_NEW ,
    --SUM (case when tran_type NOT in ('REDEMPTION','SWITCH OUT') THEN UNITS ELSE 0 - UNITS END )  AS  Num_Units,
         (select sum(case when tran_type in ('PURCHASE','SWITCH IN') then AMOUNT else 0 - AMOUNT end ) from transaction_st
         where folio_no = tst.folio_no AND SCH_CODE = tst.sch_code
         group by  folio_no,SCH_CODE) as NUM_AMOUNT_NEW ,
    --SUM (case when tran_type NOT in ('REDEMPTION','SWITCH OUT') THEN AMOUNT ELSE 0 -AMOUNT  END )  AS  Scheme_Amount,
    sum(  CASE WHEN upper(tran_type) NOT in ('REDEMPTION','SWITCH OUT') THEN
                 units * (select nav_rs from nav_rec where nav_rec.sch_code = tst.sch_code and nav_rec."Date" = /*trunc(sysdate)*/to_date('23/03/2009','dd/mm/yyyy'))
               ELSE  (0 - units) * (select nav_rs from nav_rec where nav_rec.sch_code = tst.sch_code and nav_rec."Date" = /*trunc(sysdate)*/to_date('23/03/2009','dd/mm/yyyy')) END  ) Scheme_Valuation ,
    null as SCHEMEPHRASEID ,
    null as "Prefered Mode of SOA",
    (  select sum(      case when upper(tran_type) NOT in ('REDEMPTION','SWITCH OUT') THEN AMOUNT ELSE 0 - AMOUNT END  ) from transaction_st t where t.folio_no = tst.folio_no group by folio_no )  as Folio_Amount,
                   select sum(CASE when upper(tran_type) NOT in ('REDEMPTION','SWITCH OUT') THEN
                                              units * ( select nav_rs from nav_rec where nav_rec.sch_code = ts.sch_code and nav_rec."Date" = /*trunc(sysdate)*/to_date('23/03/2009','dd/mm/yyyy'))
                                  ELSE
                                      (0 - units) * ( select nav_rs from nav_rec where nav_rec.sch_code = ts.sch_code and nav_rec."Date" = /*trunc(sysdate)*/to_date('23/03/2009','dd/mm/yyyy')) END     
                                  )  from transaction_st ts where ts.folio_no =tst.folio_no  group by ts.folio_no
    ) as Folio_Valuation
    from transaction_st   tst 
    group by folio_no ,sch_code,CHKDIGIT
    order by folio_no , SCH_CODE
    please help me

    Hi,
    You cannot use scalar subqueries in a materialized view.
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:4110947624538#22981269011674
    edit
    From 10g doc:
    ORA-22818: subquery expressions not allowed here
    Cause: An attempt was made to use a subquery expression where these are not supported.
    Action: Rewrite the statement without the subquery expression.
    (http://download.oracle.com/docs/cd/B19306_01/server.102/b14219/e19400.htm#sthref6020)
    Edited by: hoek on Jun 10, 2009 7:56 AM

  • AE crashes when I move timeslider...Please Help..!

         I'm having a problem when I move the time slider in AE. It won't move and then the program crashes. I noticed when my teacher tried to hit some buttons to move it to the begining. I've tried uninstalling and reinstalling. Nothing. Please Help.

    I'm using windows 7 64- bit proffesional, I have CS4 Master Collection Education Version. The source footage is from the first lesson in the Adobe After Effects CS5 Classroom In a Book. I am able to open and do everything in AE up untill i have to playback or move timeslider. I have many other softwares in my system, including....Autodesk Entertainment Creation Suite (Maya, 3ds Max), Corel Painter 11, Unreal Development Kit, ZBrush 4 and so on......No third party codecs or plugins. I've never used AE untill my first class yesterday. Premeire Pro works great.....playback and timeslider in it work seamlessly without stutter. I have Core 2 Duo with Nvidia GTX 260m and 6gb of ram. This is the only app in Master collection i have a problem with.

  • Corelated subquery Vs Nested Sub Query

    hi all,
    i am having a small doubt regarding the usage of corelated subqueries. what is the difference between corelated subquery & nested subquery in terms of performance. Which is more advisable to use?
    pls. help me.

    "The one that gives you the best performance when benchmarked with your data"
    I would ammend that to:
    The one that gives you the best performance and the right answer when benchmarked with your data
    John

  • Difference between sub-query and corelated subquery

    Hi,
    can anyone please give me the clear difference between sub-query and coreleated subquery with an example.
    I am very much confused with the both.
    Also please let me know in which cases/situation these are used.
    Thanks,

    Basically Sub Query is Query within Query. There are different type of SubQuery.
    1. Scalar Sub Query
    Query that is totally independent from the main query.
      select empno, (select count(*) from emp) total_emp
        from emphere the subquery is totally independent of the main query.
    2. Corelated Sub Query
    The sub query reffers to the main query.
      select empno, (select deptname from dept d where e.deptno = d.deptno) deptname
         from emp e3. Inline view
    A sub query that is used as a table or view in a SQL
    select *
      from (select empno, deptname
              from emp e, dept d
             where e.deptno = d.deptno)
    where sal > 100

  • Problem with threads and simulation: please help

    please help me figure this out..
    i have something like this:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class DrawShapes extends JApplet{
         private JButton choices[];
         private String names[]={"line", "square", "oval"};
         private JPanel buttonPanel;
         private DrawPanel drawingArea;
         private int width=300, height=200;
         public void init(){
              drawingArea=new DrawPanel(width, height);
              choices=new JButton[names.length];
              buttonPanel=new JPanel();
              buttonPanel.setLayout(new GridLayout(1, choices.length));
              ButtonHandler handler=new ButtonHandler();
              for(int i=0; i<choices.length; i++){
                   choices=new JButton(names[i]);
                   buttonPanel.add(choices[i]);
                   choices[i].addActionListener(handler);
              Container c=getContentPane();
              c.add(buttonPanel, BorderLayout.NORTH);
              c.add(drawingArea, BorderLayout.CENTER);
         }//end init
         public void setWidth(int w){
              width=(w>=0 ? w : 300);
         public void setHeight(int h){
              height=(h>=0 ? h : 200);
         /*public static void main(String args[]){
              int width, height;
              if(args.length!=2){
                   height=200; width=300;
              else{
                        width=Integer.parseInt(args[0]);
                        height=Integer.parseInt(args[1]);
              JFrame appWindow=new JFrame("An applet running as an application");
              appWindow.addWindowListener(
                   new WindowAdapter(){
                        public void windowClosing(WindowEvent e){
                             System.exit(0);
              DrawShapes appObj=new DrawShapes();
              appObj.setWidth(width);
              appObj.setHeight(height);
              appObj.init();          
              appObj.start();
              appWindow.getContentPane().add(appObj);
              appWindow.setSize(width, height);
              appWindow.show();
         }//end main*/
         private class ButtonHandler implements ActionListener{
              public void actionPerformed(ActionEvent e){
                   for(int i=0; i<choices.length; i++){
                        if(e.getSource()==choices[i]){
                             drawingArea.setCurrentChoice(i);
                             break;
    }//end class DrawShapes
    class DrawPanel extends JPanel{
         private int currentChoice=-1;
         private int width=100, height=100;
         public DrawPanel(int w, int h){
              width=(w>=0 ? w : 100);
              height=(h>=0 ? h : 100);
         public void paintComponent(Graphics g){
              super.paintComponent(g);
              switch(currentChoice){
                   case 0:     g.drawLine(randomX(), randomY(), randomX(), randomY());
                             break;
                   case 1: g.drawRect(randomX(), randomY(), randomX(), randomY());
                             break;
                   case 2: g.drawOval(randomX(), randomY(), randomX(), randomY());
                             break;
         public void setCurrentChoice(int c){
              currentChoice=c;
              repaint();          
         private int randomX(){
              return (int) (Math.random()*width);
         private int randomY(){
              return (int) (Math.random()*height);
    }//end class drawPanel
    That one's from a book. I used that code to start with my applet. Mine calls different merthod from the switch cases. Say I have:
    case 0: drawStart(g); break;
    public void drawStart(Graphics g){
      /* something here */
    drawMain(g);
    public void drawMain(graphics g){
    g.drawString("test", x, y);
    //here's where i'm trying to pause
    //i've tried placing Thread.sleep between these lines
    g.drawLine(x, y, a, b);
    //Thread.sleep here
    g.drawRect(x, y, 50, 70);
    }I also need to put delays between method calls but I need to synchronize them. Am I doing it all wrong? The application pauses or sleeps but afterwards, it still drew everything all at once. Thanks a lot!

    It is. Sorry about that. Just answer any if you want to. I'd appreciate your help. Sorry again if it caused you anything or whatever. .n_n.

  • Apple Mini DVI to Video Adapter is not working. Please Help...

    I bought an Apple Mini DVI to Video Adapter to connect my Macbook to a TV using normal video cable. When I connect the cable, my Laptop DIsplay gives a flickr once and then it shows nothing. I checked Display in the system preference where I don't get a secondary monitor option. My TV is panasonic and it's an old one. I work on Final Cut Pro and it's very very important to see my videos on a TV. What am I doing wrong with the connection? Anyone Please Please help...

    Your probably not doing anything wrong. There are thousands of users with Similar issues and it seems to be with many different adapters.
    We have Mini DP to VGA (3 different brands) and they all fail most of the time. This seems more prevalent with LCD Projectors. I've tested some (50+) with VGA Monitor (HP) and they all worked, LCD Projector (Epson, Hitachi, and Sanyo) and they all fail, DLP Projector (Sanyo) and one worked.
    My Apple Mini DP to DVi works most of the time. My Mini DP to HDMI (Generic non Apple) works every time.
    The general consensus is that Apple broke something in the OS around 10.6.4 or 10.6.5 and its not yet fixed. As we are a school we have logged a case with the EDU Support group so will see what happens.
    Dicko

  • PSE icons instead of the photo. I need to view photos at a glance. Please help me????

    Please help, this is driving me crazy.  I have downloaded my free PSE #9, it came with my Leica Camera.  I cannot view at a glance any of my photos.  There is only an icon that reads, PSE.  To view any of my photos, I must click select and then preview.  This gets old, and I am doing 4 times the work. I am having to use the dates to guess where my photos might be.  I hate this!  My old Photo Shop #5 didn't do this.  When you went to my pictures, you could see every photo.
    I have tried the right click and open as any program.  What ever program I choose, that is the icon that appears.  No photo. Still no good.
    Please help.
    Thanking anyone in advance,
    Leica

    Hi,
    Are you using Windows Explorer to view the files?
    If so, load Explorer, go to the Tools menu and select Folder Options.
    Click on the View tab and make sure the first option (Always show icons, never thumbnails) is not checked.
    Click on OK and see if that is any better.
    Brian

Maybe you are looking for

  • 3rd Party 24" LCD on a Mac Pro via VGA

    Hello, I have my Mac connected to a 3rd Party 24" LCD via a KVM, which restricts me to using VGA for the connection. With my G5, I was unable to run at 1920x1200 until I upgraded to a Radeon 9800 Pro ME video card. I'm having the same issue with the

  • Apple tv wont connect to wireless

    Hi bought an apple tv 6th may this year. Followed all instructions etc and worked perfectly.. Could access all packages etc, picked up from all our devices, iphones, ipad and imac.. Now 4 weeks later and wont connect to wireless at all. Also cant be

  • Satellite A665 SP6004M Error:f3-f100-003

    Hi. Last Sunday I tried to upgrade the Nvidia driver for the GeForce GT330M that is in my laptop. As the progress bar goes on I barely move the laptop probably drag it half an inch over the table, after that the HDD Protection pop-up window came on a

  • Run an Oracle ADF application on a tablet pc?

    I've been asked if an Oracle ADF application can run on a tablet pc. (I'm assuming XP Tablet PC Edition) . Does anyone know? If so, can I develop using JDev 10.1.3?

  • Having a problem isolating RAW files from Jpegs into separate folders.

    I have understood it to be that all file (photo) organization in Elements should be done in the Organizer.  However, I took over 500 shots in RAW + Jpeg, so now I want to place the RAW files in a separate folder so I can make thumbnails from the Jpeg