A simplish sqlplus query I'm struggling with!

Can anyone help me with this query
I have two tables
I want to select all the fields from table1 plus one extra variable field (a Boolean) tacked on the end.
The value of the extra field is set dependent on the following condition.
If The value of Field 3 of table1 exists in column 4(field 4) of table2. Then "Y" Else "N"
I think my query needs to look something like this
Select t1.*, Case when con1 then ‘Y’;
     When con2 then ‘N’;
End CASE;
From table1 t1,table2 t2
Where exists(select * from table2 t2 where t2.field4=t1.field3) con1
Thanks

Here is one of the ways.
Select t1.*, 'Y'
From table1 t1,table2 t2
Where exists(select 'X'
               from table2 t2
              where t2.field4=t1.field3)
union all
Select t1.*, 'N'
From table1 t1,table2 t2
Where not exists(select 'X'
                  from table2 t2
                 where t2.field4=t1.field3);

Similar Messages

  • Tools | Insert Query no longer supported with SAPBEX 7.0 ?

    Hi
    With SAPBEX for BW 3.5 we could use Tools | Insert Query ... in individual worksheets and then save this as a workbook. 
    Now for BW 7.0, the SAPBEX does not seem to be able to do this and the end-user must "paint" the query by inserting a navigation area, filter block and results area into the sheet and then bind these objects to an infoprovider.
    My users will struggle with this new method - has the Insert function been removed or is it hiding somewhere ?
    regards
    Ian MacLaren

    Hi,
    it's very borring to re-design a query for each sheet...
    So there is an helpful option :
    1) Open Bex Analyser
    2) Open your query
    3) DIsplay the Navigation pane (thanks to the button filter)
    4) In the navigation pane, right click on a caracteristic that is not display in your analysis grid yet
    5) choose the last option "Drill <name of the caracteristic> Across Sheets"
    6) It will duplicate the query for each value of the caracteristic, in a individual sheet for each value.
    (so... choose a caracteristic with less than 10 values)
    7) now you've got several sheets but no data.
    8) Refresh the workbook
    Now, you've got a workbook with several sheet with the same design.
    You just have to go in conception mode and change the dataprovider of the different object into each sheet.
    N.B : The button chart, filter, information doesn't work for news sheet...
    you will have to develop VBA macro or just use Excel function : Data > Group and Outline > Group... in order to hide and unhide lines and column quickly.
    Hope it's help
    Don't forget point.

  • Is anybody else struggling with an intermittent connection when using the Magic Mouse/Trackpad ONLY on Boot Camp?

    Hi,
    I've seen thousands of posts about Bluetooth connection issues and interference and stutter/lag for both the Magic Mouse and Trackpad (affecting both Mac OS X and Windows under Boot Camp) but my problem is different.
    To summarise my setup, I use:
    - Retina MacBook Pro (lid closed or open, doesn't make a difference to this problem)
    - Thunderbolt Display
    - Wireless Keyboard
    - Magic Trackpad (have also tried a Magic Mouse and experience similar issues to the Trackpad)
    And in Mac OS X, everything works perfectly. The keyboard and trackpad work smoothly when I'm 6-7 metres from the machine, whether or not the laptop lid is open or closed, and whether or not the Thunderbold Display is connected.
    But on to my problem: the bluetooth connection is incredibly unreliable/intermittent when in Windows (I run Windows 7 64-bit and Boot Camp 4.0, and got both devices connected without any trouble via Bluetooth).
    But during usage, the cursor stutters/lags frequently, and tap to click (when enabled) seems to get triggered by mistake all the time (even when I'm not touching the Trackpad or even at the computer, clicks get registered).
    The Wireless Keyboard is perfect, and works well 5 metres from the machine. The Mouse and Trackpad, though, don't even work reliably when they are 6 inches from the machine. The built-in trackpad on the laptop works perfectly too, in Windows and Mac.
    I spent a week assuming I was suffering from Bluetooth interference, so I tried:
    - using the laptop with the lid open
    - removing the Thunderbolt display completely and trying the Magic Trackpad
    - repositioning items on my desk
    - disabling wifi
    All of these adjustments made minor differences to how good/bad the Trackpad was, but none came close to fixing the problem or making it work as smoothly as under Mac OS X. It was only after doing all of this that I realised perhaps it was just a Apple driver for Windows issue, so I booted into Mac OS X and tested everything out, and sure enough, it's all perfect. But back into Windows, the Trackpad doesn't work reliably at all.
    Obviously, the hardware is not at fault, and I assume the signal strength doesn't vary between operating system (why would it?) so I'm left believing this must be a driver issue. The TrackPad and Magic Mouse drivers have been out for a couple of years, so I'm surprised they can still be this bad. I tried both the latest driver from Boot Camp 4.0 (3.2.0.0) for the Trackpad, and also the older one from Boot Camp 3.2 (3.1.0.7) and both are equally bad for me.
    So my question is: has anybody else struggled with using the Trackpad (or Magic Mouse) with Boot Camp 4.0 and Windows 7 64-bit, whilst finding it to be perfect under Mac OS? I haven't found many posts complaining about the Windows driver, which is why I assumed it was an interference issue. But I'm almost sure it isn't, having spent 2 weeks investigating.
    Any thoughts/suggestions/answers much appreciated!
    Kyle

    SOLVED!
    After much testing, I have found the cause of lagging/jumpiness on the Bluetooth Magic Mouse and Magic TrackPad in Boot Camp. Hopefully this will help others:
    The drivers for the Broadcom 802.11n Wireless Adapter have a setting called "Bluetooth Collaboration" that is Disabled by default. Enabling this option removes the problem instantly. My Magic Trackpad now works flawlessly, even if I stand 6 metres from the machine. It now works just as well as under Mac OS. The setting can be found under:
    Control Panel > Device Manager > Network Adapters > Broadcom 802.11n Network Adapter (right click and choose "Properties". Under the "Advanced" tab, highlight the setting named "Bluetooth Collaboration", then change it to Enable. Then click OK.
    I narrowed the problem down to the wireless card by disabling ALL startup services and processes for Windows, then re-enabling one by one. As soon as I enabled the Windows Wireless Service, the problem came back. Similarly, disabling the Wireless Card inside the Network and Sharing Center (or Device Manager) removes the problem. This led me to believe it must be a driver issue with the wireless card, since the problem didn't occur with the Magic TrackPad under Mac OS, or on my mother's Windows 7 64-bit computer. So when I went into the Driver Properties to check for an update, I found this setting about Bluetooth Collaboration.
    I really hope this helps others trying to use Bluetooth devices under Boot Camp. All Apple notebooks use the Broadcom card (and have done for years), so this driver is installed for almost anybody using Boot Camp on an Apple notebook. I'd assume this problem would affect anybody using Boot Camp + wifi + a Bluetooth device.
    Cheers

  • Please help me! I am struggling with the mesh tool!

    So I want to make this chair look like it does in the picture, but I cant! There is a chapter in my Illustrator CS3 book explaining how to use gradient mesh and mesh tool, but it doesnt help me at all. I am clueless!   The tutorial says that I can create points in the mesh simply by clicking with the mesh tool within an object, but when I try to do that, the pointer is "crossed out". I can only add extra points on lines or edges, but not on empty space within an object. What gives? Why is it that others can do it an I cant? Forgive me if I sound a little too upset, but I've been struggling with this for days and I cannot find an answer.
    In this tutorial right here: http://www.layersmagazine.com/illustrator-gradient-mesh-tool.html the guy just clicks in empty spaces creating intersections. In my case it is impossible.
    PS: Please look at an attached file and tell me what would be the best way to go about coloring this chair. Maybe I am doing this completely wrong? (I only started learning illustrator about 5 weeks ago)
    Sorry for the background template being of poor quality, but this was taken from a book and scanned, so it's the best I could do.

    You know something I think there should be a behavioral change in this case. To my way of thinking this option should automatically be disabled if you select the Mesh tool. If for some reason you want the mesh tool not to behave the way there might be a toggle or a double click to get the preferences for the tool 's behavior itself. I can see where this behavior can be useful but there needs to be a toggle.
    Selecting the anchors for adding color with out accidentally creating a new mesh division is good thing but you need to be able to work both ways.
    What do you think Scott Weichert you use the tool extensively, am i wrong?

  • An error occurred querying a data source - with REST services

    Hi,
    I have a SharePoint 2013 form library library with an info-path form. I need to get the logged in user's 'Display Name' on my form load automatically.
    I used REST service to fetch the current user details. In the preview mode of the form, its showing the right name. But when I publish this form to library I am getting the following error.
    REST Service --> http://site url/_api/SP.UserProfiles.PeopleManager/GetMyProperties
    Please help me to resolve this issue.
    Thanks in advance for your time and reply :)

    Hi,
    According to your post, my understanding is that an error occurred querying a data source with REST services.
    It is defiantly permission issue with GetUserProfileByName service
    and could be many reasons of this problem. You first try with UDCX file and make sure that UPS is running.
    Here are some similar threads for your reference:
    http://social.technet.microsoft.com/Forums/en-US/b8c668ea-7511-4657-a1a8-08fb4a6bd53d/info-path-an-error-occurred-querying-a-data-source?forum=sharepointcustomizationprevious
    http://social.technet.microsoft.com/Forums/en-US/46866ac2-da09-4340-a86a-af72cbb2c8d7/info-path-an-error-occurred-querying-a-data-source-?forum=sharepointcustomization
    http://blogs.msdn.com/b/russmax/archive/2012/08/17/want-to-call-sharepoint-2010-web-services-within-browser-based-infopath-2010-forms.aspx
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • I have continuously over the last 6 months struggled with syncing my iphone and ipod with itunes  The app continually crashes during the picture import.  AND by the way it takes 10-15 minutes before it even attempts to import photos.  The screen says impo

    I have continuously over the last 6 months struggled with syncing my iphone and ipod with itunes  The app continually crashes during the picture import.  AND by the way it takes 10-15 minutes before it even attempts to import photos.  The screen says importing photoes but doesnt try to optimize or anything for 10 minutes.  I have a 3gs with 16Gb so its not a cheap phone.  I have 10Gb free.  I have 6600 photoes.  This is very frustrating and undermines my confidence in your products.  My ipod is an ipod 4 with 16Gb also.  It does the exact same thing to it.  The last time, I had to import photoes a few at the time and with it taking 10-15 minutes each time for 6600 photos it is a long frustrating process.  But it will import every photo a few at a time.  The error message is just that itunes has stopped working.  no hint as to why. AND of course, my phone is out of use for the entire time.  You guys must not want to believe ur phones are a necessary tool...or maybe you dont want the consumer to believe it is.  I have tried to find solutions on your website as well as through other 3rd party communities.  Ultimately they were of no use.  I stumbled onto my solution by accident since Im a bit of a computer geek...a semi-geek.

    I have this issue too, I went into my Windows event viewer. (should have looked at this a year ago when this started)
    it said this
    Faulting application name: iTunes.exe, version: 11.0.2.26, time stamp: 0x51253247
    Faulting module name: ntdll.dll, version: 6.1.7601.17725, time stamp: 0x4ec49b8f
    Exception code: 0xc0000374
    Fault offset: 0x000ce6c3
    Faulting process id: 0x14d4
    Faulting application start time: 0x01ce194399f166ba
    Faulting application path: C:\Program Files (x86)\iTunes\iTunes.exe
    Faulting module path: C:\Windows\SysWOW64\ntdll.dll
    Report Id: 0eb3c37f-8537-11e2-9351-50465d6737de
    basically whenever I try to sync my ipod touch 4G 64GB it crashes iTunes when it begins the pictures. if im lucky ill get 4-5 on there before it stops responding. its not my system or anything im running win7x64 8GB DDR3 ram (Corsair XMS3) AMD FX Eight core processor.
    It is silly that iTunes cannot add pictures to apple devices. it shatters whatever incline I may have to buy apple products. knda like the Airport Extreem router my dad bought the new firmware, caused my router to not function... why release firmware that breaks a product. -_- <-- off topic but still

  • Hi there. I hoping for help.   I am struggling with both...

    hi there. I hoping for help.
    I am struggling with both my WRT54G router set-up and i can't seem to use your online chat system. I hope that you can help.
    I have just moved from Hong Kong to New Zealand and I'm trying to install my WRT54G, bought in Hong Kong, to connect to a Telstra braodband internet connection, but when I follow the instruction CD-ROM I get to the point (number 6 - although this point is numbered 7 in the instructions?!?) when I have connected the router it then says it is checking my settings and then it asks me to put in a password. It then checks my system again and then asks me for the password again, and this repeatedly. I can't get past this point. Because this was happening I pushed the reset button on the back of the router, but it still asks me for a password (I have tried using admin as the password without success) and then goes through the check and asks me for the password again. Any help would be great.
    Thanks.
    Michael Anthony

    What windows OS are you running? It may have not installed correctly.
    First go to control panel in start menu, then add/remove programs. it should be in there.
    If you do not see it there then go to programs files and see if it is there. if so you can delete the folder it is in, then run disk clean up.
    By manually setting up did this work? would like to know the end results.

  • Please help to re-write this query using exists or with

    Hi please help to re-write this query using exists or with, i need to write same code for 45 day , 90 days and so on but sub query condition is same for all
    SELECT SUM (DECODE (t_one_mon_c_paid_us, 0, 0, 1)) t_two_y_m_mul_ca_
    FROM (SELECT SUM (one_mon_c_paid_us) t_one_mon_c_paid_us
    FROM (
    SELECT a.individual_id individual_id,
    CASE
    WHEN NVL
    (b.ship_dt,
    TO_DATE ('05-MAY-1955')
    ) >= SYSDATE - 45
    AND a.country_cd = 'US'
    AND b.individual_id in (
    SELECT UNIQUE c.individual_id
    FROM order c
    WHERE c.prod_cd = 'A'
    AND NVL (c.last_payment_dt,
    TO_DATE ('05-MAY-1955')
    ) >= SYSDATE - 745)
    THEN 1
    ELSE 0
    END AS one_mon_c_paid_us
    FROM items b, addr a, product d
    WHERE b.prod_id = d.prod_id
    AND d.affinity_1_cd = 'ADH'
    AND b.individual_id = a.individual_id)
    GROUP BY individual_id)
    Edited by: user4522368 on Aug 23, 2010 9:11 AM

    Please try and place \ before and after you code \Could you not remove the inline column select with the following?
    SELECT a.individual_id individual_id
         ,CASE
            when b.Ship_dt is null then
              3
            WHEN b.ship_dt >= SYSDATE - 90
              3
            WHEN b.ship_dt >= SYSDATE - 45
              2
            WHEN b.ship_dt >= SYSDATE - 30
              1
          END AS one_mon_c_paid_us
    FROM  items           b
         ,addr            a
         ,product         d
         ,order           o
    WHERE b.prod_id       = d.prod_id
    AND   d.affinity_1_cd = 'ADH'
    AND   b.individual_id = a.individual_id
    AND   b.Individual_ID = o.Individual_ID
    and   o.Prod_CD       = 'A'             
    and   NVL (o.last_payment_dt,TO_DATE ('05-MAY-1955') ) >= SYSDATE - 745
    and   a.Country_CD    = 'US'

  • How to Use SQL Query having IN Clause With DB Adapter

    Hi,
    I am using 11.1.1.5 want to find out how to Use SQL Query having IN Clause With DB Adapter. I want to pass the IN values dynamically. Any ideas.
    Thanks

    invoke a stored procedure, it's safer than trying to put together an arbitrary SQL statement in the JCA adapter

  • Just moved from microsoft word, struggling with one thing . . the view

    I've just recently started using pages rather then microsoft word.
    It seems great, but there is one thing that I'm struggling with, the page view
    No Matter what I do I can't seem to show the pages left border (from the perspective of looking at the computer screen)
    In word you can see the entire page, then there is space where it finished and around the sides.
    I can't seem to get the view to show the space around the top of the first page and the left border of all the pages.
    Any help is greatly appreciated!
    Thanks in advance

    What about the view - one up option? I see it in the help but I don't see it in my document. When I click on View, I don't see one up as an option.
    Anyone know if there's a way to see one page above/below the other, rather than spread out side by side?
    It's not in the View menu. One-up & two-up is in the percentage box at the bottom left of the document.

  • Struggling with Applying Cell refences of formulas to multiple cells

    Probably a basic question- I am new to Numbers.
    Ive been struggling for ages with applying a formula or cell reference to more than one cell at a time. If I select multiple cells (shift or command clicking them) - then I am unable to create a new 'Cell References'. Pressing the equals = sign merely gives me an error sound. And the formula bar is not accessible
    I have been struggling with this on and off now for about a week. Help - well it doesn't help and implies that I am doing the right thing, but it is not working. - Please help

    marky3 wrote:
    I ve been struggling for ages with applying a formula or cell reference to more than one cell at a time. If I select multiple cells (shift or command clicking them) - then I am unable to create a new 'Cell References'. Pressing the equals = sign merely gives me an error sound. And the formula bar is not accessible
    I have been struggling with this on and off now for about a week. Help - well it doesn't help and implies that I am doing the right thing, but it is not working. - Please help
    A better use for your time was to read carefully *Numbers User Guide* and *iWork Formulas and Fucnctions User Guide*.
    We may insert a reference to a range of cells in a cell's formula but we can't insert a formula in several cells with a single task.
    The correct protocol is :
    insert the formula in the first cell of the range then use the fill down (or fill up or fill to the right or fill to the left) feature.
    Yvan KOENIG (VALLAURIS, France) dimanche 21 février 2010 22:21:40

  • I mistakenly wiped my mac ox from my macbook and i'm struggling with getting it fixed or getting a new one to install.

    i mistakenly wiped my mac ox from my macbook and i'm struggling with getting it fixed or getting a new one to install. Can anyone help me?  thanks
    <Email Edited By Host>

    Restart the Mac and hold down Command+Option+R. Choose to reinstall OS X. The version of OS X your Mac came with will be installed.

  • Can I use custom query in DB Adapter with Polling

    Hi All,
    I am getting problem while using db adapter with polling. Can I use custom query in db adapter with polling.
    I am using 2 tables; table 1 and table2
    Structure of table1 is as:
    File_name
    Batch_id
    Creation_date
    Status
    Structure of table2 is as:
    Batch_id
    Employee_ID
    Last_Name
    First_Name
    Middle_Name
    Group_ID
    Site_ID
    Dept_Num
    Report_id
    I have to use below query while polling to table1
    Select count(*) as NOSEXP, Report_id
    from table1, table2
    where table2.batch_id =
    table2.batch_id
    and table1.Status= 0
    group by Report_id;
    I mean, when I use DB adapter to poll table1, I have to use above query.
    Can you Please suggest on this.
    Thanks in advance.

    I will check for existance not based on Primary key but based on three other fields in the table. I think , by default DB adapter configured for MERGE checks for existance based on PK. Can we change the Primary Key in the mapping file after the DB adapter is configured. In that case , will it check for existance based on the fields , I mention.
    Edited by: user12020809 on Sep 16, 2012 6:08 PM

  • Query on Driver Compatibility with Oracle 9i & Oracle 11g

    Technical query on Driver Compatibility with Oracle 9i & Oracle 11g of our client scenario
    1. There are 2 databases, FCDB and FCR DB. Both the databases are running on Oracle 9i. FCDB Application present is using the same version of JDBC driver (classes12.jar) to communicate with FCDB Local and FCR Host Database. And it is JDK 1.4 compliant.
    2. We require upgrading the FCDB alone to 11g Release 1 and FCR DB with same Oracle 9i.
    3. In this case, if the application is using the same version of JDBC driver (classes12.jar) to communicate with FCDB Local and FCR Host Database, will there be any issues.
    4. Need to check if there is any issues related to the classes12.jar with 11g Release 1 DB whether oracle will extend their support to us and how and when they can they provide it.
    5. If there are any issues, can that be resolved by Oracle Support?
    Edited by: user13290657 on Mar 4, 2011 12:41 PM

    This forum deals with migrations from foreign databases to Oracle.
    You might better post your request in this forum:
    http://forums.oracle.com/forums/category.jspa?categoryID=288

  • SendXMLtoClient -- struggling with it - Help!!

    Hi,
    I am trying to do do an example of the "Client Call Addin Response DTD" i.e. pass
    an XML document to an external java
    program.
    As given in docs :
    http://e-docs.bea.com/wli/docs70/devclient/appa.htm#1120726
    1. I have created a template definition
    2. Defined a XML doc.
    (as per the Client Callin Request DTD) and attached to
    ActionSendXMLToClient event as shown below.
    <call-addin name="mywlpi.addinimpl" mode="async">
    <actionid>959395846210</actionid>
    <parm>itemNumber</parm> </call-addin>
    3. "mywlpi.addinimpl" is a java program I created
    4. Now, the problem I run into is
    when I run from Worklist (Swing client program), it errors out
    saying it cannot find this class file:
    ClassNotFoundException: mywlpi.AddInImpl
    java.lang.ClassNotFoundException: mywlpi.AddInImpl
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    5. I have included the class file in a .jar and included in the
    SVRCP of startWebLogic.cmd file. Also, when I create a
    Business Operation from Studio, I can locate this Java class.
    So, I am not sure what is missing. The strange part is when I
    run from the Worklist JSP page, it errors out saying : "Cannot
    execute this task, because it is already done." The task is not
    yet done.
    Is there someone who can help me here? Any suggestions
    appreciated!!
    Thanks, SLN

    You say you added the class to the server classpath but you don't say that
    you've added it to the client's classpath. Its the client that is giving you the
    error, right? If so, is the class in the worklist's classpath?
    In article <3d2f6575$[email protected]>, "SLN" says...
    >
    >
    Hello!!! How come no one has responded to this one???
    PLEASE HELP!!!!!!!!!!!!!!!!!!!!!!!!!!
    I AM STRUGGLING WITH THIS ONE!! I thought dev2dev newsgroup
    is pretty good :-(
    "SLN" <[email protected]> wrote:
    Hi,
    I am trying to do do an example of the "Client Call Addin Response DTD"
    i.e. pass
    an XML document to an external java
    program.
    As given in docs :
    http://e-docs.bea.com/wli/docs70/devclient/appa.htm#1120726
    1. I have created a template definition
    2. Defined a XML doc.
    (as per the Client Callin Request DTD) and attached to
    ActionSendXMLToClient event as shown below.
    <call-addin name="mywlpi.addinimpl" mode="async">
    <actionid>959395846210</actionid>
    <parm>itemNumber</parm> </call-addin>
    3. "mywlpi.addinimpl" is a java program I created
    4. Now, the problem I run into is
    when I run from Worklist (Swing client program), it errors out
    saying it cannot find this class file:
    ClassNotFoundException: mywlpi.AddInImpl
    java.lang.ClassNotFoundException: mywlpi.AddInImpl
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    5. I have included the class file in a .jar and included in the
    SVRCP of startWebLogic.cmd file. Also, when I create a
    Business Operation from Studio, I can locate this Java class.
    So, I am not sure what is missing. The strange part is when I
    run from the Worklist JSP page, it errors out saying : "Cannot
    execute this task, because it is already done." The task is not
    yet done.
    Is there someone who can help me here? Any suggestions
    appreciated!!
    Thanks, SLN

Maybe you are looking for

  • Can i only use one computer at a time?

    I have 2 computers that are one the same network. One mac and one PC desktop. The airport is connected to the Mac but my PC still recognizes it. I have tried to connect the PC to airtunes, but it will not connect.. If i configure that as I did on the

  • Help with JTree

    I wrote a cls that extends JTree....I have defined the root node in this class. Public class a extends JTree{ /// global variable nd constructor public void JTReader() DefaultMutableTreeNode root = new DefaultMutableTreeNode("root");            m_mod

  • Where is the enable 3g option in ios 7

    Hi.. i hav a iphone 4s and is upgraded to ios 7... but i cant enable 3g as there is no option for the same

  • How to truncate currency part from total field in SAP B1?

    Hi All, Is there any way to truncate the currency part (for exp USD 23.45 should give 23.45) from total columns while fetching its value thru DI API (without left-trailing the varchar part)? many thanks in advance.. regards, Binita

  • Wave File Has No Audio in Playback

    I have several wave files that don't have an audio when played back. There appears to be frequency levels and when opened in Soundtrack Pro the peaks are moving. I have tried playing the file in iTunes, and Final Cut Pro to no avail. There are a coup