Another series of clause if select [V 10g]

Hi experts,

I have 18 select statements. Each select will return the number of records.

Select Count (*) in v1
Select Count (*) in the v2
Select Count (*) in the v3
Select Count (*) in the v4
Select Count (*) from v5
Select Count (*) in the v6
Select Count (*) in the v7
Select Count (*) in v8
Select Count (*) in v9
Select Count (*) in v10
Select Count (*) in the v11
Select Count (*) from v12
Select Count (*) in v13
Select Count (*) in v14
Select Count (*) from v15
Select Count (*) from v16
Select Count (*) in v17
Select Count (*) from v18

Now, if the first select statement returns number > 0, then I don't want to run another select statement.

How can I encode at best... ???

My approach is to go with if within the fi.  East - reliable?

If you want in PLSQL, then change the above given code:

DECLARE
Number of V_CNT1;

Number of V_CNT2;

.

.

Number of V_CNT18;
BEGIN
Select Count (*) in the V_CNT1 of v1;
IF V_CNT1 = 0 then
Select Count (*) in the V_CNT2 of v2;

IF V_CNT2 = 0 then

Select Count (*) in the V_CNT3 of v3;

IF V_CNT3 = 0 then

.

.

.

-Correctly the end of the IF block

ON THE OTHER

ENDIF;
DBMS_OUTPUT. Put_line ('Count is greater than 0');
END;
/

Tags: Database

Similar Questions

  • Can satellite A100 (PSAAR) I use another series XP drivers?

    Today, I saw that model PSAAR drivers are available for Vista (and other?)

    Can I choose 'other' option for Windows XP Home edition or should I wait for a few moments to be sure?

    Hello

    Of course, you can test another series A100 XP drivers.
    Several different laptops series uses the same devices and single pilots must be compatible and should run on other units A100

    But why you open new discussions. On this theme, you have already posted twice.
    http://forums.computers.Toshiba-Europe.com/forums/thread.jspa?threadID=20980
    http://forums.computers.Toshiba-Europe.com/forums/thread.jspa?threadID=20949

    Followed other threads on the same topic and DON T open again.

  • Insert using the table with the clause and select?

    Hello gurus,

    Can I insert in a table by making use of clause and select?

    something similar to this...
         insert into test_table
          (with abc as 
              (select * from emp_tble
               where dept_no = 10
               )
             select * from abc;
       );          
    
         if not i would i do by making use of  with clause & select ... any example would be great !!
    
    
      
    Thank you very much!!!

    Brackets are disturbing only:

    SQL> insert into test_table
       (with t as (select * from emp) select * from t)
    /
    Error at line 12
    ORA-32034: unsupported use of WITH clause
    
    SQL> insert into test_table
      with t as (select * from emp) select * from t
    /
    14 rows created.
    
  • When you type in the selected tab, he caught another open tab is not selected, how is it fixed?

    For example:
    I have 3 open legs.
    I have selected 1 tab, I switch to tab 3 and continue typing (Log in details for example)
    When you type it out, I sign types out on the tab 1, instead of 3, sometimes I don't check and press enter (causing it to enter in table 1, which would cause me to show my password on another website)

    I switch between tabs like 3 - 4 times to set the priority.

    Start Firefox in Firefox to solve the issues in Safe Mode to check if one of the extensions of the origin of the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > appearance/themes).

  • table update, cancel the change, another session could ' get value changes in 10g

    Edit data in a table, then advanced to change its original value. In general another session could get changed by advanced in select value but it not work. After the "starting strength" I can get it.

    I did this test in 11.2.0.3 and I get the value without the "starting strength". Who can tell me why? Thank you very much.

    ORACLE 10.2.0.1, OS rhel5.4 x86_64

    session1:

    SQL > create table ty (name varchar (20));

    Table created.

    SQL > insert into ty values ('XXXX');

    1 line of creation.

    SQL > commit;

    Validation complete.

    SQL > update ty set name = "YYYY";

    1 line update.

    SQL >

    session2:

    change cancel

    Select

    INDX,

    ktuxesta,

    ktuxecfl,

    ktuxesqn,

    ktuxesqn envelope #.

    ktuxescnw scnW,

    SNCB ktuxescnb,

    ktuxerdbf dba_file,

    ktuxerdbb dba_block,

    nub ktuxesiz

    Of

    x$ ktuxe

    where

    ktuxesta = 'ACTIVE '.

    ;

    KTUXESTA KTUXECFL KTUXESQN # SCNW DBA_FILE DBA_BLOCK NUB SNCB WRAP INDX

    ---------- ---------------- ------------------------ ---------- ---------- ---------- ---------- ---------- ---------- ----------

    263 ACTIVE NO 4 4 0 736229 5 59 1

    BED > define dba 5,59

    S/N 0X0140003B (5,59 20971579)

    BED > find/c XXXX

    File: /oracle/oradata/ora10/undotbs02.dbf (5)

    Block: 59 Offsets: 1361 in 1872 Dba:0x0140003b

    ------------------------------------------------------------------------

    58585858 0000000c 00480020 001 0002 001300e2 00000000 01000000 010000e2 c

    0000000b 01140008 0401003 b fd070000 00000086 fd070000 a 00400101 002, 0086

    00000019 0de30277 00000000 00000000 00000000 00000004 016d18bc 9c0a0000

    2a 000010 0000005 00170004 002b 0000 00400101 9c0a00ba 80000075 0e4000b9 b

    0e4000ff 12058102 0000002c 0000002f 00070600 00040001 00000002 c1170180

    01800778 72021315 162e0180 0180000c 00180010 001 0002 00150005 02000005 c

    02000000 00000000 0000000b 01133000 00040002 016d18bc 2a00003b 00400101

    002e0008 10400001 12058101 00000065 00090700 00070002 0000002c 104000ff

    00000001 80018001 80018001 8002c 109 07787202 1315162e 0000000c 00180010

    001C 0002 00150005 02000005 02000000 00000000 0000000 01132f00 00040002 b

    016d18bc 2a00003b 00400101 002f0007 10400001 104000ff 12058102 0000002c

    00000037 00090700 00070002 00000002 01800180 01800180 07787202 c10e0180

    1315162e 0000000c 00180010 001 0002 00150005 02000005 02000000 00000000 c

    0000000b 01132e00 00040002 016d18bc 2a00003b 00400101 002c 0007 10400001

    104000ff 12058102 00000036 00090700 00070002 00000002 c10e0180 0000002c

    01800180 01800180 07787202 1315162e 0000000c 00180010 001 0002 00150005 c

    < 32 bytes per line >

    BED > d/v s/n 1361 offset 5.59 County 10

    File: /oracle/oradata/ora10/undotbs02.dbf (5)

    Block: 59 Offsets: Dba:0x0140003b 1361 to 1370

    -------------------------------------------------------

    58585858 0000000c l 0048 XXXX... H

    < 16 bytes per line >

    BED >

    BED > change/c Davis dba 5,59 1361 offset

    WARNING: the content of previous BIFILE will be lost. Move forward? Y (Y/N)

    File: /oracle/oradata/ora10/undotbs02.dbf (5)

    Block: 59 Offsets: Dba:0x0140003b 1361 to 1370

    ------------------------------------------------------------------------

    44444444 0000000c 0048

    < 32 bytes per line >

    BED > sum dba 5,59 apply

    Check file 5, block 59 value:

    current = 0x0c0a, required = 0x0c0a

    BED > d/v s/n 1361 offset 5.59 County 10

    File: /oracle/oradata/ora10/undotbs02.dbf (5)

    Block: 59 Offsets: Dba:0x0140003b 1361 to 1370

    -------------------------------------------------------

    44444444 0000000c l 0048 Davis... H

    < 16 bytes per line >

    BED >

    session3:

    SQL > conn / as sysdba

    Connected.

    SQL > alter system flush buffer_cache;

    Modified system.

    SQL > alter system flush shared_pool;

    Modified system.

    SQL > conn ty/ty

    Connected.

    SQL > select * from ty.

    NAME

    --------------------

    XXXX

    SQL >

    SQL > startup force

    ORACLE instance started.

    Total System Global Area 285212672 bytes

    Bytes of size 2020192 fixed

    83889312 variable size bytes

    192937984 of database buffers bytes

    Redo buffers 6365184 bytes

    Mounted database.

    Open database.

    SQL > conn ty/ty

    Connected.

    SQL > select * from ty.

    NAME

    --------------------

    DELALANDE

    SQL >

    In 11g

    Oracle OS: RHEL X86_64 6.2 11.2.0.2

    session1:

    SQL > select * from test;

    NAME

    --------------------

    XXXX

    SQL > update test set name = "YYYY";

    1 line update.

    SQL >

    session2:

    SQL > /.

    KTUXESTA KTUXECFL KTUXESQN # SCNW DBA_FILE DBA_BLOCK NUB SNCB WRAP INDX

    ---------- ---------------- ------------------------ ---------- ---------- ---------- ---------- ---------- ---------- ----------

    343 ACTIVE NO 1288 1288 0 1738249 3 242 1

    BED > set s/n 3 242

    S/N 0X00C000F2 (12583154 3 242)

    BED > find/c XXXX

    File: /oradata/oradata/ora10/undotbs01.dbf (3)

    Block: 242 Offsets: 5741 to 6252 Dba:0x00c000f2

    ------------------------------------------------------------------------

    58585858 0000000 c 004 c 0020 0002 001400 010000 00000000 01000000 cd cd 001C

    0000000b 01130008 010000 00014 010e00ed 7d1a0000 00C 000000f2 0c 000000ee

    7d1a0000 530c8b99 861 000000f8 has 0000 00000 00000000 00000004 00C 00d7dbf2

    0de4dbff 7e000005 00200004 c 0500007 01b 00024 012f0000 80000096 861a 0062

    0c 400060 0c4000ff 12058101 0000002c 00070600 00030001 00000002 00db005c

    c10702c1 79640b0b 07018007 14151601 80018016 001d000c 004c 0020 00020002

    00020007 00010001 000000 cd cd b 010000 00000000 01000000 0000000, 01060008

    0c 010000 00014 000000ed 00000090 7d1a0000 7d1a0000 010d00c6 00C 000000f2

    cea43485 861 has 0000 00000 00000000 00000004 8fb30005 0d 000000 00C 000000f1

    001f0004 c 0500007 01b 00024 012e0000 861a 0062 80000082 0c 400060 0c4000ff

    0000002c 12050101 00db0054 000706ff 00040005 00020003 00000001 ff000000

    000600c 1 3f0000c1 610000c 1 16000079 640b0b14 15160080 00000080 0000000 c

    c 004 0020 0002 001400cd 010000 00000000 01000000 0000000b 01210008 cd 001C

    0c 010000 000000f2 00C 7c1a0000 000000C6 7d1a0000 00000090 00014 010c006f

    861a 0000 00000 00000000 00000004 0de4dbff 7e000005 06C 00000065 cea43471

    001C 0004 0500007c 01b 00024 012d 0000 8000006e 861a 0062 0c 400060 0c4000ff

    < 32 bytes per line >

    BED > change the offset of 3 242 s/n/c Davis 5741

    WARNING: the content of previous BIFILE will be lost. Move forward? Y (Y/N)

    File: /oradata/oradata/ora10/undotbs01.dbf (3)

    Block: 242 Offsets: 5741 to 6252 Dba:0x00c000f2

    ------------------------------------------------------------------------

    44444444 0000000c 004c 0020 0002 001400cd 010000 00000000 01000000 cd 001C

    0000000b 01130008 010000 00014 010e00ed 7d1a0000 00C 000000f2 0c 000000ee

    7d1a0000 530c8b99 861 000000f8 has 0000 00000 00000000 00000004 00C 00d7dbf2

    0de4dbff 7e000005 00200004 c 0500007 01b 00024 012f0000 80000096 861a 0062

    0c 400060 0c4000ff 12058101 0000002c 00070600 00030001 00000002 00db005c

    c10702c1 79640b0b 07018007 14151601 80018016 001d000c 004c 0020 00020002

    00020007 00010001 000000 cd cd b 010000 00000000 01000000 0000000, 01060008

    0c 010000 00014 000000ed 00000090 7d1a0000 7d1a0000 010d00c6 00C 000000f2

    cea43485 861 has 0000 00000 00000000 00000004 8fb30005 0d 000000 00C 000000f1

    001f0004 c 0500007 01b 00024 012e0000 861a 0062 80000082 0c 400060 0c4000ff

    0000002c 12050101 00db0054 000706ff 00040005 00020003 00000001 ff000000

    000600c 1 3f0000c1 610000c 1 16000079 640b0b14 15160080 00000080 0000000 c

    c 004 0020 0002 001400cd 010000 00000000 01000000 0000000b 01210008 cd 001C

    0c 010000 000000f2 00C 7c1a0000 000000C6 7d1a0000 00000090 00014 010c006f

    861a 0000 00000 00000000 00000004 0de4dbff 7e000005 06C 00000065 cea43471

    001C 0004 0500007c 01b 00024 012d 0000 8000006e 861a 0062 0c 400060 0c4000ff

    < 32 bytes per line >

    BED > apply sum s/n 3 242

    Check file 3, block 242 value:

    current = 0xae88, required = 0xae88

    BED >

    session3:

    SQL > alter system flush buffer_cache;

    Modified system.

    SQL > conn ty/ty

    Connected.

    SQL > select * from test;

    NAME

    --------------------

    DELALANDE

    SQL >

    SQL > select version of v$ instance;

    Version

    -----------------

    11.2.0.2.0

    SQL >

    Hell _in_memory_undo parameter

  • How to animate keyframes, which I copied into After Effects to mirror the same movement as another series of keyframes?

    Screen Shot 2015-12-12 at 3.39.03 PM.pngLayer of biker to right leg. Screen Shot 2015-12-12 at 4.14.56 PM.png Biker body layer.

    You add an expression to the property that you want to order by selecting the property and then by holding down the Alt/Option key. Here are the basics: Adobe - search: the expressions. Learn more by typing key words such as expressions in the field search for help in the upper right corner of the AE.

    If you want keyframes in a single layer to match the keyframes in another, then you can link the properties with a simple expression that is created by dragging the pickwhip to layer property from the slave to copy the master layer that you want to track. This example would bind the rotation of a layer to another rotation. The second expression would offset values and is an example of how you define in your animation cycle to the top of the opposite leg. You just know how many images there are in the cycle. Just go to the last image and read the number of frame. It's easier if you have the calendar set up to read in frames. Change the display time by holding down the Ctrl/Cmnd key by clicking on the time indicator.

    If you want to have the slave shift layer in time, then you add an argument valueAtTime expression as in this example using the rotation property of the main layer:

    r = thisComp.layer("Master").transform.rotation;

    offset = r.valueAtTime (time +. 5)

    This assumes that your cycle of keyframes is 1/2 second.

    If you are more comfortable working with frames in seconds and then you change the expression like this assuming that the number of images in your game to keyframe is 15:

    TF = 15; Number of the frame in the last keyframe in the cycle

    r = thisComp.layer("Master").transform.rotation;

    TTF = tf/(1/thisComp.frameDuration);

    offset = r.valueAtTime (time + ttf)

    Here is an example of pin simple puppet:. Dropbox - Expression leads to foot Cycle CC 12 aep (If your browser adds a .txt extension, simply remove it and you should be able to load the project 2012 CC and later). I arranged the workspace so that it was easy to see what I had done. Given that I've created a loop instead of a ping-pong of the keyframe in the middle of the cycle was used as at the beginning. Have fun...

  • "Engine of profiles is not available for the series in the worksheet selected" during the execution of a simulation

    When I run a simulation for a worksheet, it gives following message

    "Profiles of engine not available for the series in the selected worksheet. "To simulate the Please add relevant series of Simulation."

    http:// < Server: port >/engineManager/EngineManagerStarterServlet? Command = Status gave status as -1 (running). I started the server in simulation mode.

    Not sure that the question may be.

    Is there a log file where I can find more in detail. If so, what is the file name and where it is stored

    The error message indicates that the engine did not find a series in the worksheet to run the Simulation.

    Add the series of simulation and try again to call the simulation engine.

    Kind regards

    Shekhar

  • I receive in my Start menu another instance of Firefox to select that reference the site pornhub, which went never consciously to. How permanently remove this instance in my Start menu?

    I have the menu item "Mozilla Firefox" habitual, frequent of the websites listed in my Start menu in Windows 7. But another element of Mozilla Firefox/instance appear very often in my Start menu that references the site pornhub. I was never consciously
    This site and did NOT want to see it listed in my menu start.
    How can I permanently remove or disable this?

    Do a check with some malware malware, analysis of programs on the Windows computer.

    You need to scan with all programs, because each program detects a different malicious program.

    Make sure that you update each program to get the latest version of their databases before scanning.

    See also:

  • Start Menu problem - another file opens when I select a file to open in the start menu

    original title: Start Menu problem

    I use windows Vista Home Edition.  The start menu is in Vista Mode.  When I select a file the third file above that that I select opens.  In classic mode, it works fine.  How can I fix it?

    Hello

    Try the methods provided below and see if they help to resolve the issue.

    Method 1:

    This looks like a problem with Windows Aero, I would say that you update the card drivers video from the manufacturer's website and check if that helps.

    http://Windows.Microsoft.com/en-us/Windows-Vista/update-a-driver-for-hardware-that-isn ' t-work correctly

    Method 2:

    You can navigate on troubleshooting Aero:

    http://Windows.Microsoft.com/en-us/Windows-Vista/troubleshoot-problems-with-Windows-Aero

  • The value of another field using the multiple-selection list

    Hello

    I have a multi select list as USER name name...
    In these cases, I select several users as For example JOHN AND JACK
    Database that should get both their email ID then fill in textarea (separated by commas)

    As I am new to apex, pls help.

    Welcome to this forum... :))

    What is your version of the database?

    If you use database 11g then you can use the following query for your condition,

    select LISTAGG(user_email, ':') WITHIN GROUP (ORDER BY user_email) from table_name
    where INSTR(':'||NVL(:PX_USERNAME,user_name)||':',':'||user_name||':')>0
    

    instead of PX_USERNAME use the name of your multi selection list.

    Use this query in your textfield.

    Thank you
    Lacombe

  • produce a series of numbers to select from the shortcomings of the ID column

    (1)

    Suppose I have a table t that contains lines like this:

    A AND B
    ---------- ----------
    2 4
    6 7

    I would like to use select to produce lines with numbers between a column and column B included
    for each line, like this:

    Select from t...

    2
    3
    4
    6
    7

    (2)

    Suppose I have the ID column that is lacking, I want to get the lowest < N > numbers available between the gaps.
    I did some research and I can find the range of gaps, but I can't get the numbers listed separately, therefore
    I ask the question (1). But is there a direct way for the list instead of going through beaches and the list.

    For example, I have the ID column that has

    2
    5
    6
    7
    9
    2000000

    I would get a select query that produces

    Select...

    3
    4
    8
    10
    11

    I have a way to get a list of 2 to 2000000, then less than what we need to get all the
    numbers of the gap, but who is not effective and may is short-term memory.

    PS: before I post on this group, I did some research already on "connect by", with recursive queries.

    PuraVidaOTN wrote:

    I would like to use select to produce lines with numbers between a column and column B included

    for each line, like this:

    Assuming that no duplicates in the table...

    with t as
    (
     select 2 c1,4 c2 from dual union all
     select 6 c1,7 c2 from dual
    )
    select c1,c2,c1+level-1 c
    from t
    connect by c1+level-1 <= c2
    and prior c1 = c1
    and prior c2 = c2
    and prior sys_guid() is not null;
    
    C1 C2 C
    -- -- -
     2  4 2
     2  4 3
     2  4 4
     6  7 6
     6  7 7 
    

    Suppose I have the ID column that is lacking, I want to get the lowest numbers between the gaps.
    I did some research and I can find the range of gaps, but I can't get the numbers listed separately, therefore
    I ask the question (1). But is there a direct way for the list instead of going through beaches and the list.

    I have a way to get a list of 2 to 2000000, then less than what we need to get all the
    numbers of the gap, but who is not effective and may is short-term memory.

    It's the best way in my opinion...

    Or rather less, you can try outer join...

    Published by: JAC on December 19, 2012 21:28

  • How to assign a value of string comman separated in the Clause of SELECT m

    In table A, I followed values

    Price ID
    -- ------
    1 100
    2,200
    3 300
    4 400
    6 500

    Now, in table B, I have following values

    Product price combi
    --------- ----- --------
    OIL 600 '1', ' 2 ', 3'

    What I do is, first of all get the combi in table B value and then get the count of the table has.

    In condition, it should return 3...

    create or replace procedure amit_combi_test
    as
    v_combi varchar2 (100);
    tot_row number (10);
    cursor table_combi is
    Select combi
    b;

    BEGIN
    OPEN table_combi.
    LOOP
    EXTRACT the table_combi in v_combi;
    EXIT WHEN table_combi % NOTFOUND;
    dbms_output.put_line (v_combi);

    Select count (1) INTO tot_row
    a.
    WHERE ID in (v_combi);

    dbms_output.put_line (to_char (tot_row));

    END LOOP;

    CLOSE Table_combi;
    END;

    But the problem is... it shows the value of the variable tot_row = 0; It should come 3...

    ace_friends22 wrote:
    Thank you all, but it seems regexp_ functions and xmltable are not available in Oracle 9.2... I tried to use it, but it says invalid identifier......

    So why it is always a good idea to display the version of your database with your question, especially if you use a version not supported by the database, otherwise we have to assume that you use one of the latest versions supported. This saves also we are wasting our time.

  • Want TO Sleekbook 6-1090ee: laptop, showing ANOTHER series and model number in the information system

    Hello

    I return my HP laptop a few weeks of the repair shop. It worked very well, no lags, virus, etc. So... One day I decided to check the system information to see if my cell phone is compatible to run a game. I was going through the information and I saw this:

    System model: laptop HP Envy 4 (SA in FACT 6)

    My laptop was showing the serial number some R000000000000 and the registered serial number the back of my laptop is COMPLETELY DIFFERENT. Now I'm starting to feel a bit suspicious of what the hell happened to my laptop.

    Laptop: Sleekbook 6-1090ee ENVY

    Any help would be appreciated

    Kind regards

    Magali

    (Sorry if my English is bad)

    Hello:

    I suggest to contact the repair center and ask them what they were doing to repair your laptop.

    From what you wrote, it seems to me like they replaced the motherboard with a used 4 envy, which probably uses the same motherboard as the envy of 6.

    The only major difference between the models would be the size of the display screen.

    A used replacement motherboard would have a different serial number than the original one provided with your PC.

    A repair shop would need a special tool of DMI BIOS HP to change the serial number on the motherboard to match that on the bottom of your PC case.

    So, if you are happy with the repair work, they did and the specifications of the system are the same as they were before you sent the PC for repair, I wouldn't be too concerned with matching serial numbers is more.

  • Another series of recent buggy XP SP3 updates KB2572073 KB2633880 KB2518864

    Tonight, both of my XP SP3 boxes receive 3 updates to .net 2.0 offered several times;

    KB2572073
    KB2633880
    KB2518864

    I find that odd, especially when we're between update cycles.

    Whenever I told it to install, it finally says "successful installation" AND THEN opens again (wteher I reboot or not).

    Happened to the point where I uninstalled .net 2.0 a box hoping it would disappear (it also has 3.5 & 4.0). Unfortunately the "control center" for my ATI Radeon 3450 'control center' would not go 2.0 is installed. Having convinced MS I wanted to install 2.0 & NOT reinstall 4.0 (although I also tried), I have the ATI utility works once more, but I still get these security updates provided on & on.

    Is this a real security problem, or should I just hide them?

    MS must have been aware of this problem. On the pc that I applied the fix, it re dl had its own updates & they installed. On the other pc, the problem simply disappeared.

  • Selection of the list of clients using the clause "EXISTS".

    Dear all,

    I have 3 tables, say,

    TABLE1:

     

    CUST_CODE

    (PRIMARY KEY)

    CUST_NAME

    CUST_COUNTRY_CODE

    CUST_CITY_CODE

    CUST_AREA_CODE

    A

    CUST1

    COU1

    CIT1

    A1

    B

    CUST2

    COU2

    CIT2

    A2

    C

    CUST3

    COU2

    CIT2

    A3

    D

    CUST4

    COU3

    CIT4

    A4

    E

    CUST5

    COU3

    CIT5

    A5

    TABLE2

     

    STOCK_SYS_ID

    (PRIMARY KEY)

    STOCK_CUSTOMER_CODE

    STOCK_CUSTOMER_

    COU_CODE

    STOCK_

    CUSTOMER_

    CIT_CODE

    STOCK_

    CUSTOMER_

    ARE_CODE

    STOCK_DOC_

    CREATED

    1

    A

    [Leaving empty as we have reference only to the customers and the date here...]

    10/15/2015

    2

    B

    15/09/2015

    3

    A

    16/08/2015

    4

    C

    18/08/2015

    5

    E

    22/07/2015

    6

    C

    31/01/2015

    7

    A

    15/10/2014

    TABLE 3

     

    AREA_CODE

    AREA_COUNTRY_CODE

    AREA_CITY_CODE

    A1

    COU1

    CIT1

    A2

    COU2

    CIT2

    A3

    COU3

    CIT2

    A4

    COU3

    CIT3

    A5

    COU4

    CIT5

    How can I find the list of clients of TABLE1, which are present in TABLE2 by 2015 and have country-city-zone, both correct mapping as specified in section TABLE3 using the clause "EXISTS".

    Is that my output will be like,

     

    CUST_CODE

    (ONLY CORRECT CUSTOMER CODES)

    CUST_NAME

    A

    CUST1

    B

    CUST2


    Thanks in advance,

    Séverine Suresh

    Hello

    So, you want to see 3 columns in table1 correspond to 3 columns in t3.  It is not enough for only 1 column equal:

    Area_Code must be equal

    country_code and must be equal

    city_code and must be equal.

    Here's a way to encode that, by using the EXISTS operator in a WHERE clause:

    SELECT cust_no, cust_name

    FROM table1 t1

    WHEN THERE IS)

    SELECT 0

    Table 3 T3

    WHERE t3.area_code = t1.cust_area_code

    AND t3.area_country_code = t1.cust_country_code

    AND t3.area_city_code = t1.cust_city_code

    )

    ;

    I hope that answers your question.

    If not, please post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and the results you want to start from these data (otherwise what you've posted already).

    Explain, using specific examples, how you get these results from these data.

    Always say what version of Oracle you are using (for example, 11.2.0.2.0).

    See the FAQ forum: Re: 2. How can I ask a question on the forums?

Maybe you are looking for