Looking for a best query for multiple IF Else statement in a single select

Hi
I want to run multiple IF Else statements in a single select SQL, each statement is one SQL operating on the same table, what is the best way to write this select SQL query ?
If it is PL/SQL, when i get the result from the first IF statement I will skip the remaining execution, and so on... Can any one help me on this.
Thanks in advance !!

965818 wrote:
I Apologize, the information i have given might not be enough.
This is my scenario,
I am selecting set of rows from the table for the employee id. After selecting those records,
i need to go through the result list and check the condition 1, if it is met, i will return that employee record.
If that condition 1 is not met, then i need to go through the condition 2. If that is met, i will return that record.
Like wise, i have four conditions.
I am trying to achieve this in a single sql. If i am not clear, please let me know.Not fully clear yet, but the picture is better already. The thing with SQL is that you should stop thinking procedurally. Instead think in data sets.
For example if the task is:
Find all managers that work in sales.
Procedural thinking would work like this:
pseudo code
Loop over all employees that work in sales
   for each row
       check if it is a manager
           if manager
              then return record
           else
              do nothing
           end
end loopThinking in datasets will result in a different logic
pseudo code
select all employees
where department = SALES
and job = MANAGERThis advantage here is that all the "Do nothing" loops are not needed. Those are already eliminated by the database.
So what is needed to help you? Give the full picture. What is your task that you try to solve. From a business perspective.

Similar Messages

  • Business Package for SAP Best Practices for Enterprise Portal

    Hi,
    We are implementing EP for ECC 5.0 and we have to web enable some FI transactions like FB50/fb60 etc. We want to use standard business package for this. The only business package that caters this requirement is "Business Package for SAP Best Practices for Enterprise Portal 60.1". When i checked the data source for this business package, the specification is for "SAP R/3 4.6B and above". Does this work for ECC 5.0 as well? In general does the R/3 specific business packages work for ECC versions? Please let me know. Thanks for the help.  I promise rewards.
    Regards
    Hari

    Hari,
    When you download the BPO via Portal Content Portfolio,
    each bpo has additional information on the release.
    For example for the one you are inquiring about - Business Package for SAP Best Practices for Enterprise Portal, the additional release information is provided on the following links;
    https://www2.iviewstudio.com/sdn/info/index.cfm?action=faqs&part=#QSR03
    https://www2.iviewstudio.com/sdn/detail_view/index.cfm?action=package_information&CatalogSet=SAP%20Content&ItemID=17212&CFID=7544845&CFTOKEN=99283970
    Regards,
    James

  • Question for Kappy: Best guide for moving a user to a new Mac?

    Really anyone could answer, but Kappy, you gave me such a great, detailed step-by-step guide on migrating to a new drive ( My 3rd Party SSD won't mount ) that I use it religiously. I wanted to ask you if you could point to the best process for moving a user from one Mac to another, the absolute best way. I typically use this website:
    http://pondini.org/OSX/Setup.html
    But I thought I'd ask for your sage wisdom first.
    Thanks for reading!

    Lord Zero wrote:
    Thanks Baby Boomer. I will probably stick with the pondini site, then, being that a 3rd party is more likely to discuss the warts in the process.
    Pondini (RIP) was a valuable contributor in the Community.  Thankfully, his websites live on!!!

  • Looking For Guidance: Best Practices for Source Control of Database Assets

    Database Version: 11.2.0.3
    OS: RHEL 6.2
    Source Control: subversion
    This is a general question aimed at database professionals, however, it is not specific to any oracle version, etc.  Its a leadership question for other Oracle shops regarding source control.
    The current trunk, in my client's source control, is the implementation of a previous employee who used ER Studio.  After walking the batch scripts and subordinate files , it was determined that there would be no formal or elegant way to recreate the current version of the database from our source control - the engineers who have contributed to these assets are no longer employed or available for consulting.  The batch scripts are stale, if you will.
    To clean this up and to leverage best practices, I need some guidance on whether or not to baseline the current repository and how to move forward with additions of assets; tables, procs, pkgs, etc.  I'm really interested in how larger oracle shops organize their repository - what directories do you use, how are they labeled...are they labeled with respect to version?
    Assumptions:
    1. repository (database assets only) needs to be baselined (?)
    2. I have approval to change this database directory under the trunk to support best practices and get the client steered straight in terms of recovery and
    Knowns:
    1. the current application version in the database is 5.11.0 (that's my client's application version)
    2. this is for one schema/user of a database (other schemas under the database belong to different trunks)
    This is the layout that we currently have and for the privacy of the
    client I've made this rather generic.  I'd love to have a fresh
    start...how do I go about doing that...initially, I like using
    SqlDeveloper's ability to create sql scripts from a connected target. 
    product_name
      |_trunk
         |_database
           |_config
           |_data
           |_database
           |_integration
           |_patch
           |   |_5.2A.2
           |   |_5.2A.4
           |   |_5.3.0
           |   |_5.3.1
           |
           |_scripts
           |   |_config
           |   |_logs
           |
           |_server
    Thank you in advance.

    HiWe are using Data ONTAP 8.2.3p3 on our FAS8020 in 7-mode and we have 2 aggregates, a SATA and SAS aggregate. I want to decommission the SATA aggregate as I want to move that tray to another site. If I have a flexvol containing 3 qtrees CIFS shares can I use data motion (vol copy) to move the flex vol on the same controller but to a different aggregate without major downtime? I know this article is old and it says here that CIFS are not supported however I am reading mix message that on the version of data ONTAP we are now on does support CIFS and data motion however there will be a small downtime with the CIFS share terminating. Is this correct? Thanks

  • Looking for the best solution for downgrading a database from 11.2 to 11.1

    we have an install of 11.2 grid and have made several attempts at adding 11.1 binaries and using the 11.2 infrastructure. we patched, etc... but all of our attempts failed in getting 11.1 to work across the cluster.
    we have decided to make all of the installs version 11.1.
    I am looking for the most straight forward approach to migrate our 11.2 down to 11.1 with the least amount of downtime.
    thanks, tom

    Hi Tom;
    Please check below note
    Master Note For Oracle Database Downgrade [ID 1151427.1]
    How To Downgrade From Database 11.2 To Previous Release [ID 883335.1]
    I belive it will answer all your question.
    Please also check below links:
    http://blogs.oracle.com/db/2010/09/master_note_for_oracle_database_downgrade_doc_id_11514271.html
    Regard
    Helios

  • Any recommendations for the best strategy for converting 2007 QuickBooks to 2014 QB for Mac?

    Hi Everyone,
    I am considering the purchase of my first Mac. Looking at the 21.5 inch. I currently use QuickBooks 2007 on a Windows XP service pack 3. I am wondering how to best handle the conversion. Do you think my QB 2007 would flow over to the QB for Mac 2014 or should upgrade my data to QuickBooks 2012 first? I don't do payroll and process retail sales transactions with Quickbooks so I don't think I'd have any issues with running the Mac version. Any tips or suggestions would be greatly appreciated. Thanks!

    Hi Everyone,
    I am considering the purchase of my first Mac. Looking at the 21.5 inch. I currently use QuickBooks 2007 on a Windows XP service pack 3. I am wondering how to best handle the conversion. Do you think my QB 2007 would flow over to the QB for Mac 2014 or should upgrade my data to QuickBooks 2012 first? I don't do payroll and process retail sales transactions with Quickbooks so I don't think I'd have any issues with running the Mac version. Any tips or suggestions would be greatly appreciated. Thanks!

  • Dock for W530 - Best source for purchasing 5 of them

    After much deliberation (and my boss telling me we are only allowed to get Lenovo's), we've decided on the W530 for our next laptop in the Systems department where I work. I found a great deal on a W530 with upgraded CPU and the nice 1080p screen for under $1250 new (cdw.com), which was great because my company doesn't want to spend over $1300 on laptops.
    However, the dock is hard to find. I can't find any legit sources for it. There is only one dock we're considering, which is described as:
    Lenovo 433835U ThinkPad Mini Dock Plus Series 3 with USB 3.0 - 170W
    It's not available from any of our usual sources, so my question is: What is the best source to get these?
    Two sources I've found for them are:
    http://www.thinkpad-parts.com/433835U-Thinkpad.html
    http://www.iportreplicator.com/index.php?route=product/product&path=100&product_id=53
    I'm curious if others have ordered from these sites and what kind of experiences have you had. Or perhaps someone knows a better source to get the dock. I need it to be around $300 or less, new or refurb but not used. Thanks!

    The docks are very expensive. I just spent some time looking for one. I have never bought anything from either supplier you list so I cannot comment. I ended up getting a used one without a power supply and getting the power supplier somewhere else. You need to make sure it has the connector to fit the 170W AC adapter.  Sometimes, the line between used and refurbished is not clear; the most important thing is that you can return it if it is defective, whether it is new, refurbished or used

  • Exporting Animated Slides for widescreen - Best format for export?

    I need to build a looping video to be played on a bunch of flat-screen TV's mounted to a trade-show booth. I'm guessing I need to build it for wide-screen - 16.9 ratio?
    I used iMovie to build a simple video of images panning in and out. When I go to export, I can use the simple option of Share and if I choose their large option it exports as 950x540. That didn't seem right so I used the export to QuickTime and have selected the NTSC 720x480 16:9 Option.
    Is this going to give me the best playback after I turn it into a DVD for playback?
    Thanks.

    When I go to export, I can use the simple option of Share and if I choose their large option it exports as 950x540.
    Actually, it should be saying 960x540 which is a 16:9 aspect ratio.
    That didn't seem right so I used the export to QuickTime and have selected the NTSC 720x480 16:9 Option.
    If you plan to turn it into a standard DVD for playback in a commercial DVD player, then it makes no difference as long as the iMovie project is setting the anamorphic flag correctly. Authoring the DVD will automatically convert the input file to an encode matrix of 720x480 no matter what its current physical dimensions may be. Further the authoring application will also not and set the DVD anamorphic flag to match your iMovie project (as long as the flag is not lost) so the playback device will know how the display the 720x480 data encode on the DVD.
    Is this going to give me the best playback after I turn it into a DVD for playback?
    Hard to tell. You neglected to mention the size and codec for the source content, or the compression format used in your "Export Using QuickTime" work flow. Passing the data through the work flow at is highest possible data rate and letting the final MPEG-2 compressor do the final scaling at the appropriate data rate (determined by length and your choice of option) probably produces the best results.

  • Help using multiple if else statements & manual dynamic xml data input to trigger a goto and play.

    Below is code that has a timer countdown that reads off of the computer. Below in bold is code to read "if it reaches the date, go to and play frame (2).
    timer.removeEventListener(TimerEvent.TIMER, updateTime);
      timer.stop();
      gotoAndPlay(2);
    Below is code that is manual input-   I had set up a dynamic txt field in flash named it : raffle_tix_remain When loaded on to the host I can manulally update the xml code and the change will take effect.
    raffle_tix_remain.text = root.loaderInfo.parameters.raffle_tix_remain;
    My question:  Since the raffle_tix_remain is a manual input from a user to xml  Is there a way to tell flash once it refreshes and "raffle_ tix_ remain"  goes to (0) zero gotoAndPlay(2); and let it play like a "sold out" sign
    i guess that would be a  if else statement. 
    Code Below-----------------
    stop();
    var year:Number = 2011;
    var month:Number = 12;
    var day:Number = 30;
    var finalDate:Date = new Date(year,month-1,day);
    var timer:Timer = new Timer(100);
    timer.addEventListener(TimerEvent.TIMER, updateTime);
    timer.start();
    function updateTime(e:TimerEvent):void{
              var now:Date = new Date();
              var remainTime:Number = finalDate.getTime() - now.getTime();
              if (remainTime >0) {
                        var secs:Number = Math.floor(remainTime/1000);
                        var mins:Number = Math.floor(secs/60);
                        var hours:Number = Math.floor(mins/60);
                        var days:Number = Math.floor(hours/24);
                        var secsText:String = (secs%60).toString();
                        var minsText:String = (mins%60).toString();
                        var hoursText:String = (hours%24).toString();
                        var daysText:String = days.toString();
                        if (secsText.length < 2) {secsText = "0" + secsText;}
                        if (minsText.length < 2) {minsText = "0" + minsText;}
                        if (hoursText.length < 2) {hoursText = "0" + hoursText;}
                        if (daysText.length < 2) {daysText = "0" + daysText;}
                        day_txt.text = daysText;
                        hour_txt.text = hoursText;
                        min_txt.text = minsText;
                        sec_txt.text = secsText;
              else {
                        timer.removeEventListener(TimerEvent.TIMER, updateTime);
                        timer.stop();
                        gotoAndPlay(2);

    stop();
    var year:Number = 2011;
    var month:Number = 12;
    var day:Number = 30;
    var finalDate:Date = new Date(year,month-1,day);
      var now:Date = new Date();
    var timer:Timer = new Timer(1000);
    timer.addEventListener(TimerEvent.TIMER, updateTime);
    timer.start();
    function updateTime(e:TimerEvent):void{
             var remainTime:Number = finalDate.getTime() - now.getTime()-e.currentCount;
              if (remainTime >0 || raffle_tix_remain==0) {
                        var secs:Number = Math.floor(remainTime/1000);
                        var mins:Number = Math.floor(secs/60);
                        var hours:Number = Math.floor(mins/60);
                        var days:Number = Math.floor(hours/24);
                        var secsText:String = (secs%60).toString();
                        var minsText:String = (mins%60).toString();
                        var hoursText:String = (hours%24).toString();
                        var daysText:String = days.toString();
                        if (secsText.length < 2) {secsText = "0" + secsText;}
                        if (minsText.length < 2) {minsText = "0" + minsText;}
                        if (hoursText.length < 2) {hoursText = "0" + hoursText;}
                        if (daysText.length < 2) {daysText = "0" + daysText;}
                        day_txt.text = daysText;
                        hour_txt.text = hoursText;
                        min_txt.text = minsText;
                        sec_txt.text = secsText;
              else {
                        timer.removeEventListener(TimerEvent.TIMER, updateTime);
                        timer.stop();
                        gotoAndPlay(2);

  • Best practice for linking fields from multiple entity objects

    I am currently transitioning from PHP to ADF. I'm looking for the best practice for linking data from multiple entity objects.
    Example:
    EO 'REQUESTS' has fields: req_id, name, dt, his_stat_id, her_stat_id
    EO 'STATUSES' has fields: stat_id, short_txt_descr
    'REQUESTS' is linked to EO 'STATUSES' on: STATUSES.stat_id = REQUESTS.his_status_id
    'REQUESTS' is also linked to EO 'STATUSES' on: STATUSES.stat_id = REQUESTS.her_status_id
    REQUESTS.his_status_id is independent of REQUESTS.her_status_id
    When I create a VO for REQUESTS, I want to display: REQUESTS.name, REQUESTS.dt, STATUSES.short_txt_descr (for his_stat_id), STATUS.short_txt_descr (for her_stat_id)
    What is the best practice for accomplishing this? It appears I could do it a few different ways:
    1. Create the REQUESTS VO with a LOV for his_stat_id and her_stat_id
    2. Create the REQUESTS VO with the join to STATUSES performed within the query for the VO. This would require joining on the STATUSES EO twice (his_stat_id, her_stat_id)
    3. I just started reading about View Links - would that somehow do what I'm looking for?
    I also need to be able to update his_status_id and her_status_id through the by selecting a STATUSES.short_txt_descr from a dropdown.
    Any suggestions on how to approach such a stupidly simple task?
    Using jDeveloper 11.1.2.2.0 if that makes a difference in the solution.
    Thanks ahead of time,
    CJ

    CJ,
    I vote for solution 1 as it's just your use case. As you said you what to update the his_status_id and her_status_id through the by selecting a STATUSES.short_txt_descr by a drop down. This is exactly the LOV solution.
    ViewLinks are used fro master detail navigation (which you don't do here) and Joining the data make it difficult to update (and you still need a LOV for the drop down box.
    Timo

  • Looking for the best app that has a timer for self portraits for my Iphone 5

    I am looking for recommendations for the best app for my IPhone 5. An app that allows you to take your own picture without having to hold the phone. Something with a timer?

    Thanks, I checked it out but it didn't mention anything about having a timer so you could take your own picture without having to hold the phone.

  • Best parameter for passwd cache in nscd.conf

    Hello,
    I'm looking for the best parameter for passwd cache in nscd.conf for a mailserver.
    Our environment:
    SunFire V240, Solaris 9, 2GB Memory, 2 CPU
    about 5000 users in an OpenLDAP 2.1.x-Directory
    pam_ldap, nss_ldap (PADL)
    The users must authenticate for IMAP, POP and SMTP_AUTH (about pam_ldap) against the local LDAP-Server and the SMTP-Server also looks there for local accounts.
    It seems, that the time to authenticate (and e.g. directory listing) takes too long at the first access. The second time the access is faster and I think, it has to do with the nscd cache.
    But, which values are right for the passwd cache for such an environment?
    Any hints are welcome!
    Thanks,
    Heidrun Schmidt

    The man page for nscd.conf gives some performance enhancing suggestions.
    Also, What is your cache hit rate on the LDAP server? In Sun ONE, I have to increase the slapd cache size for large environments. Also, is the LDAP configured for the correct indexes?
    Are you sure the mail server processes use the UNIX auth mechanism or do they query the LDAP directly (ala Sun ONE iMS)? If they query LDAP directly, then nscd is bypassed.
    HTH,
    Roger S.

  • Best Practices for new iMac

    I posted a few days ago re failing HDD on mid-2007 iMac. Long story short, took it into Apple store, Genius worked on it for 45 mins before decreeing it in need of new HDD. After considering the expenses of adding memory, new drive, hardware and installation costs, I got a brand new iMac entry level (21.5" screen,
    2.7 GHz Intel Core i5, 8 GB 1600 MHz DDR3 memory, 1TB HDD running Mavericks). Also got a Superdrive. I am not needing to migrate anything from the old iMac.
    I was surprised that a physical disc for the OS was not included. So I am looking for any Best Practices for setting up this iMac, specifically in the area of backup and recovery. Do I need to make a boot DVD? Would that be in addition to making a Time Machine full backup (using external G-drive)? I have searched this community and the Help topics on Apple Support and have not found any "checklist" of recommended actions. I realize the value of everyone's time, so any feedback is very appreciated.

    OS X has not been officially issued on physical media since OS X 10.6 (arguably 10.7 was issued on some USB drives, but this was a non-standard approach for purchasing and installing it).
    To reinstall the OS, your system comes with a recovery partition that can be booted to by holding the Command-R keys immediately after hearing the boot chimes sound. This partition boots to the OS X tools window, where you can select options to restore from backup or reinstall the OS. If you choose the option to reinstall, then the OS installation files will be downloaded from Apple's servers.
    If for some reason your entire hard drive is damaged and even the recovery partition is not accessible, then your system supports the ability to use Internet Recovery, which is the same thing except instead of accessing the recovery boot drive from your hard drive, the system will download it as a disk image (again from Apple's servers) and then boot from that image.
    Both of these options will require you have broadband internet access, as you will ultimately need to download several gigabytes of installation data to proceed with the reinstallation.
    There are some options available for creating your own boot and installation DVD or external hard drive, but for most intents and purposes this is not necessary.
    The only "checklist" option I would recommend for anyone with a new Mac system, is to get a 1TB external drive (or a drive that is at least as big as your internal boot drive) and set it up as a Time Machine backup. This will ensure you have a fully restorable backup of your entire system, which you can access via the recovery partition for restoring if needed, or for migrating data to a fresh OS installation.

  • What is the best method for backing up photos in IPhoto?

    I have over 10,000 photos in IPhoto and am looking for the best method for doing a backup (or an archive?).  I'm now using ICloud and it appears it's just photo streaming and does not have storage capability. External hard drive, copying to a DVD, other suggestions?

    Most Simple Back Up
    Drag the iPhoto Library from your Pictures Folder to another Disk. This will make a copy on that disk.
    Slightly more complex:
    Use an app that will do incremental back ups. This is a very good way to work. The first time you run the back up the app will make a complete copy of the Library. Thereafter it will update the back up with the changes you have made. That makes subsequent back ups much faster. Many of these apps also have scheduling capabilities: So set it up and it will do the back up automatically. Examples of such apps: Chronosync or DejaVu . But are many others. Search on MacUpdate
    My Routine
    My Library lives on my iMac. It’s Backed up to  two external hard disks every day. These disks are permanently attached to the iMac. These back ups run automatically. One is done by Time Machine, one is a bootable back up done by SuperDuper
    It’s also backed up to a portable hard disk when ever new photos are added. This hard disk lives in my car. For security, this disk is password protected.
    I have a second off-site back up at a relative’s house across town. That’s updated every 3 or 4 months.
    My Photos are backed up online. There are many options: Flickr, Picasa, SmugMug etc. However, check the terms of your account carefully. While most sites have free uploading, you will often find that these uploads are limited in terms of the file size or the bandwidth you can use per month. For access that allows you to upload full size pics with no restrictions you may need to pay.
    Every couple of months I test the back ups to make sure they are working correctly. It’s very easy to mis-configure a back up application, and the only way to protect against that is to do a trial restore.

  • Best practices for start with itunesu

    Hi people, I from Barcelona Spain, We start deploy itunesU for our university. We have a públic and private site, the públic site work with públic site manager.
    I looking for the best way for vídeos and feeds, I try Podcast Producer 2, feeder and podcast maker.
    Podcast maker, is cool option but xml not have a “elements” for itunesU
    Feeder: is the best option, do a perfect xml for itunesu
    Podcast Producer 2, i don’t understand the diference rss feeds or atom feeds, the workflow do it a ipod version and apple tv version, in públic site manager I add rss feed and i can see a ipod version, appletv version or audio version, in atom feed only a ipod version, Why?
    I create a workflow with name of courses
    Podcast Producer no have “elements” for itunesu, (category, order, etc...)
    the name of author it’s the same of username in podcast Producer.
    Dou you need a edit xml file (UUIDNumber_offeed.cache) for add itunesu elements.
    Any poll of software for publish in itunesU?
    Sorry for my english
    Thaks a lot

    Hi people, I from Barcelona Spain, We start deploy itunesU for our university. We have a públic and private site, the públic site work with públic site manager.
    I looking for the best way for vídeos and feeds, I try Podcast Producer 2, feeder and podcast maker.
    Podcast maker, is cool option but xml not have a “elements” for itunesU
    Feeder: is the best option, do a perfect xml for itunesu
    Podcast Producer 2, i don’t understand the diference rss feeds or atom feeds, the workflow do it a ipod version and apple tv version, in públic site manager I add rss feed and i can see a ipod version, appletv version or audio version, in atom feed only a ipod version, Why?
    I create a workflow with name of courses
    Podcast Producer no have “elements” for itunesu, (category, order, etc...)
    the name of author it’s the same of username in podcast Producer.
    Dou you need a edit xml file (UUIDNumber_offeed.cache) for add itunesu elements.
    Any poll of software for publish in itunesU?
    Sorry for my english
    Thaks a lot

Maybe you are looking for

  • Finding row attribute data in the debugger

    Open a Row object in the debugger and you get an incredible tangle of data with non-explanatory names. What I can't find is that actual attribute data that the Row holds. Is there any kind of general rule for finding it?

  • Problem in Uploading sales order text data using LSMW

    Hi All, I am facing Problem in uploading open sales order data from legacy to SAP using LSMW. We are trying to upload sales order data using LSMW Standard Batch/Direct input using program name RVINVB10 and program type D. We are not able to upload it

  • Error Occurred During the Posting - Cash Document Posting (DPM)

    Dear Experts, while trying to Post the Cash Documents  from DPM session we got the below message : we have tried to check the application log by pressing on the button in the screen "application log" but we get nothing just the same message that appe

  • [SOLVED] .bashrc on framebuffer (outside X)

    outsinde X the root bash doesn't seem so listend to /root/.bashrc so I dont have a colored promt there and also cant change my LC_MESSAGES language. What can I do to change that? Thanks in advance. Last edited by miro279 (2010-11-09 17:45:27)

  • Changes need to done Customized Reports when upgrading to R12

    Hi, My Client is upgrading to R12, I need to prepare technical Document(stepwise changes need to done) for all customized and oracle reports to make working same in R12 as well. Can any one help me about essential prerquisite which i need to consider