Good query... filter look please

Hello

Collate under scenario, here I just need to filter the records that ST & ST_NEW as "Hard closed" and need to retrieve more records...

I expect 4 documents to be retrieved on 5... but its shows me just 3 disks... can yoh remodify the filter condition to extract 4 records...

< br >

WITH T as
(
1 SELECT ID, ST "Hard closed", "archived" DOUBLE ST_NEW
UNION ALL
2. SELECT ID, ST 'Hard closed', ST_NEW 'Hard closed' of THE DOUBLE
UNION ALL
3. SELECT ID, 'Hard' ST ST_NEW 'Hard closed' of THE DOUBLE
UNION ALL
4. SELECT ID, 'Open', 'archived' ST_NEW OF the DOUBLE ST
UNION ALL
SELECT 5 ID, ST 'pen', 'Feather' ST_NEW FROM DUAL
)
SELECT * FROM T
WHERE
DECODE (ST, 'Hard Closed', ST, ST) & lt; & gt; DECODE (ST_NEW, 'Hard Closed', ST_NEW, ST_NEW)

< here >

Thank you...

Published by: BluShadow on April 12, 2011 12:59
fixed the & lt; & gt; that is a question of forum.

Your decode statements aren't really do anything because if the value is "hard closed" or not, each provides the same value.

You must create a difference for example

SQL> ed
Wrote file afiedt.buf

  1  WITH T as
  2  (
  3  SELECT 1 ID,'Hard Closed' ST,'Archived' ST_NEW FROM DUAL
  4  UNION ALL
  5  SELECT 2 ID,'Hard Closed' ST,'Hard Closed' ST_NEW FROM DUAL
  6  UNION ALL
  7  SELECT 3 ID,'Hard' ST,'Hard Closed' ST_NEW FROM DUAL
  8  UNION ALL
  9  SELECT 4 ID,'Open' ST,'Archived' ST_NEW FROM DUAL
 10  UNION ALL
 11  SELECT 5 ID,'pen' ST,'pen' ST_NEW FROM DUAL
 12  )
 13  SELECT * FROM T
 14  WHERE
 15* DECODE(ST,'Hard Closed',0,1) != DECODE(ST_NEW,'Hard Closed',0,-1)
SQL> /

        ID ST          ST_NEW
---------- ----------- -----------
         1 Hard Closed Archived
         3 Hard        Hard Closed
         4 Open        Archived
         5 pen         pen

SQL>

Tags: Database

Similar Questions

  • After updating my iPhone 6 (9.3.4) the WiFi signal becomes very low! I did everything, but the problem does not stop! I don't a not update my other devices &amp; their very good WiFi signals. Please help me solve this terrible problem...

    After updating my iPhone 6 (9.3.4) the WiFi signal becomes very low! I did everything, but the problem does not stop! I don't a not update my other devices & their very good WiFi signals. Please help me solve this terrible problem...

    Here's a tip for the user on the problems of Wi - Fi. Suggest from the top and bottom. Maybe one of them will help you.

    (1) restart you device.

    (2) resetting the network settings: settings > general > reset > reset network settings. Join the network again.

    (3) reboot router/Modem: unplug power for 2 minutes and reconnect. Update the Firmware on the router (support Web site of the manufacturer for a new FW check). Also try different bands (2.4 GHz and 5 GHz) and different bandwidths (recommended for 2.4 to 20 MHz bandwidth). Channels 1, 6 or 11 are recommended for 2.4 band.

    (4) change of Google DNS: settings > Wi - Fi > click the network, delete all the numbers under DNS and enter 8.8.8.8 or otherwise 8.8.4.4

    (5) disable the prioritization of device on the router if this feature is available. Also turn off all apps to VPN and retest the Wi - Fi.

    (6) determine if other wireless network devices work well (other iOS devices, Mac, PC).

    (7) try the device on another network, i.e., neighbors, the public coffee house, etc.

    (8) backup and restore the device using iTunes. Try to restore as New first and test it. If ok try to restore the backup (the backup may be corrupted).

    https://support.Apple.com/en-us/HT201252

    (9) go to the Apple store for the evaluation of the material. The Wi - Fi chip or the antenna could be faulty.

    Council: https://discussions.apple.com/docs/DOC-9892

  • I'm not good in English so please use English very easy. I downloaded a trial (30 days) first pro and I can find it where I can remove programs, but I can't find the program anywhere. I searched on his record, but he was not first pro. do I have to d

    I'm not good in English so please use English very easy. I downloaded a trial (30 days) first pro and I can find it where I can remove programs, but I can't find the program anywhere. I searched on his record, but he was not first pro. What should I do?

    + I use windows and 32-bit computer

    If your computer is 32-bit, you can not install first pro. It is 64-bit only: system requirements | Adobe Premiere Pro

  • I'm not good in English so please use English very easy. I downloaded a first pacifier (30 days) pro and I can find it where I can remove programs, but I can't find the program anywhere. I searched on his record, but he was not first pro. do I have to d

    I'm not good in English so please use English very easy. I downloaded a first pacifier (30 days) pro and I can find it where I can remove programs, but I can't find the program anywhere. I searched on his record, but he was not first pro. What should I do?

    This is a double post of:

    I'm not good in English so please use English very easy. I downloaded a trial (30 days) first pro and I can find it where I can remove programs, but I can't find the program anywhere. I searched on his record, but he was not first pro. do I have to d

  • looking for a good query/analytic solution for data below

    I have data like shown below:

    mob_id status_code status_text media_date
    39585 600 online 4 August 09
    54988 600 online 5 August 09
    39585 600 online 5 August 09
    39585 600 online 6 August 09
    39585 600 online August 7 09
    39585 600 online 8 August 09
    39585 600 online 9 August 09
    39585 600 online 10 August 09
    39585 600 online 11 August 09
    39585 600 online August 12 09
    39585 600 online 13 August 09
    39585 600 online 14 August 09
    39585 600 online 15 August 09
    39585 600 online 16 August 09
    39585 700 uninstall August 17 09
    54988 600 online 6 August 09
    54988 600 online August 7 09
    54988 600 online 8 August 09
    54988 600 online 9 August 09
    54988 600 online 10 August 09
    54988 600 online 11 August 09
    54988 600 online August 12 09
    54988 600 online 13 August 09
    54988 600 online 14 August 09
    54988 600 online 15 August 09
    54988 600 online 16 August 09
    39585 600 online 20 August 09
    39585 600 online 21 August 09
    39585 600 online 22 August 09
    39585 600 online 23 August 09
    39585 600 online 24 August 09
    39585 600 online 25 August 09
    39585 700 uninstall 26 August 09
    39585 600 online 27 August 09
    39585 600 online 28 August 09
    39585 600 online 29 August 09
    39585 600 online 30 August 09
    39585 600 online 31 August 09
    39585 600 online 01-Sep-09
    39585 700 uninstall 02-Sep-09
    54988 600 online 17 August 09
    54988 600 online 18 August 09
    54988 600 online 19 August 09
    54988 600 online 20 August 09
    54988 600 online 21 August 09
    54988 600 online 22 August 09
    54988 600 online 23 August 09
    54988 600 online 24 August 09
    54988 600 online 25 August 09
    54988 700 uninstall 26 August 09
    69875 600 online 20 August 09
    69875 600 online 21 August 09
    69875 600 online 22 August 09
    69875 600 online 23 August 09
    69875 600 online 24 August 09
    69875 600 online 25 August 09
    69875 600 online 26 August 09

    Using the above data I need to know the result set below. Can be a help in this?

    -----------------------------------------------------------------------------------------------------------------------------------
    occurrnace_seq mob_id start_media_date end_media_date no_of_days
    -----------------------------------------------------------------------------------------------------------------------------------
    1 39585 4 August 09 17 August 09 13
    2 39585 20 August 09 August 26 09 6
    3 39585 27 August 09 02 / Sep / 09-6
    1 54988 5 August 09 August 26 09 21
    1 69875 null null 20 August 09
    -----------------------------------------------------------------------------------------------------------------------------------

    Here are start_media_date with status_code = 600 & end_media_date can be found with status_code = 700.
    Please look at the mobility_id begins several times.

    Can someone help me in producing this result using SQL or PL/SQL.

    Thanks in advance.

    Thank you
    Guttiwas

    Hello

    A way

    select      row_number() over      (partition by mob_id
                        order by start_media_date) occurnance_seq
          , mob_id
         , start_media_date
         , end_media_date
         , (end_media_date -start_media_date) no_of_days
    from     (
         select      mob_id
              , media_date start_media_date
              , lead(media_Date) over (partition by mob_id order by mob_id, media_date) end_media_date
              , status
         from      (
              select      mob_id
                   , media_date
                   , status
                   , lag(status) over(partition by mob_id order by mob_id,media_date) p_status
              from t1
              )
         where      status = 700
              or p_status is null
              or p_status = 700
         )
    where status = 600
    
    OCCURNANCE_SEQ     MOB_ID START_MED END_MEDIA NO_OF_DAYS
    -------------- ---------- --------- --------- ----------
                 1      39585 04-AUG-09 17-AUG-09         13
                 2      39585 20-AUG-09 26-AUG-09          6
                 3      39585 27-AUG-09 02-SEP-09          6
                 1      54988 05-AUG-09 26-AUG-09         21
                 1      69875 20-AUG-09
    

    Concerning
    Anurag Tibrewal

  • ADFBC-ADF Faces: slow query filter

    Hi community, I have a VO maped with a larger table, this VO is filter with setwhereclause, query works fine but it is too slow in all consultations.

    I'm really confused tried everything but the request is still very slow.

    Thanks Comunity.

    Hi Peter, I have a solution to your problem, when you perform a filter with a method in the ViewObject implementation with this.setWhereClause (); Positional JDBC and consultation is built as follows:

    SELECT * FROM (ORIGIN REQUEST VO) WHERE (YOUR CUSTOM FILTER)

    This type of filter produces a query of doble reprocessing, in tables with many registers reduces the performance and speed of the query.

    Try to use filters with viewCriterias, check your Oracle named binding style and use filter like that in your VO implementation:

    //----

    ViewCriteria vc = this.createViewCriteria ();
    Vcr1 ViewCriteriaRow = vc.createViewCriteriaRow ();
    VCR1.SetAttribute ("COD", "MyValue");
    VC. Add (VCR1);
    this.applyViewCriteria (vc);
    this.executeQuery ();

    //----

    More information [http://download-west.oracle.com/docs/cd/B32110_01/web.1013/b25947/bcquerying.htm#BCGIFHHF]

    Good luck.

  • Really good GUI? help please

    Hi guys (and girls, if any).

    I develop a UIApplication and want to know if you know guys any good packets of GUI that can be used. I don't want to use the same classic look and feel that is provided in the

    net.RIM.BlackBerry.UI.Component.whatever. packages I want something different and fancy and snazzy if possible. Any ideas? all the tools? all the packages? anything @ all. Or is it possible to customizingthe default appearance to look very different from what the standard labels, buttons, etc. Fielsd look like?

    Thank you

    Dan

    I have this version that I just compiled in 4.2.1.  I suspect things will work not (like NegativeMarginScreen), but more work okay, shape memory.  Sorry I have no idea what I changed or why, and I probably did something quick and dirty so he can work.  Good luck.

  • Dissect of Eloqua own AdWords Landing Page and URL with query string parameters, please!

    I presume that for AdWords landing pages are one of the most common types in use. I'm at a new company and try to create an approach that uses the latest methods. HAFS is gradually, and a large part of the information contained in the Topliners is old (2011) as these popular posts

    What is the best way to track Google adwords through Sales Force?
    How to capture Sources referring to forms and Landing Pages using query strings

    and the references using javascript to analyze the parameters in the screens that is 2009 and is not exactly what Eloqua uses today.

    I started to look at what Eloqua uses in its own marketing efforts and saw the potentially useful parts and parts that are confusing. I thought it would be useful if someone could dissect the code of the landing page and explain how each part of the code is. I'm OK with short descriptions and references to other articles or messages to explain the different parts that have not changed.

    Here's a page url to use. I added 'x' before each additional parameter then click top ruin the campaign stats.

    http://demand.Eloqua.com/LP=3461?elqoffer=xGartnerMQ & GoogleCampaign = xEloqua & SLS = xPPC_Google_Eloqua_2012 & gclid = xCKGFzcHyh7YCFQThQgod7lMAyg

    Here are some specific questions that I hope can be answered:

    • What you rely on Google to deliver you in their reports vs. what you capture discrete parameters: elqoffer, GoogleCampaign and sls
    • You use the gclid itself? How?
    • Is there a new better method for parsing of URLS and using hidden fields settings?
    • How do you use Eloqua cookies at the same time to send the form of Adwords?
    • You dynamically change the landing page?

    Thank you!

    Hi Mike,.

    I'm on the Ops of Eloqua Marketing team and can shed light on some of your questions.  I hope this helps!

    • What you rely on Google to deliver you in their reports vs. what you capture discrete parameters: elqoffer, GoogleCampaign and sls

    • elqoffer - we use elqoffer to indicate that the offer is valid for adword.  The value we deliver is used for many things.  Of course, we use it for reporting purposes, but we also set up our steps to use this value in a hidden field to redirect to the appropriate page supply once the form and also send the appropriate autoresponder of form processing.  We set up a dropdown list (aka select list) cards offer URL values (for the page of the offer) and another list of choices cards offer values to email ID (for the answering machine).
    • elqchannel - we also usually include a query string for the elqchannel who tells us the General source of the Contact (e.g. Google, Bing, etc.).
    • SLS - is essentially the Source of lead (sls = source of specific lead).  We use it to fill a hidden fields that reach "lead Source - Original" and 'Lead Source - the most recent'.  For us, the source of the specific lead is a very granular (and non-General, such as 'research') but includes a lot of information based on a strict naming convention.
    • That's what we use Eloqua to adwords, but we also use an SEO company to help us optimize our search spend.  To do this, they provide their own tracking code we put on the landing page initial as well as the page of the offer (ie. confirmation page).  To get the code on our LP, we use the cloud "Static content" component that allows you to place any custom code you want in the body of the HTML code.  Unfortunately, I don't have details on what exactly is captured with this code, or how it is used.
  • You use the gclid itself? How?
    • I don't know the answer to this one.  It's someone else on our team that works closely with an SEO company, so I think they know.
  • Is there a new better method for parsing of URLS and using hidden fields settings?
    • YES!  You may have noticed, we have some Javascript on our landing page that does a few things.  First of all, he did a Web data search in Eloqua to see if you are a known visitor and if so, we can pre-fill the form with information we already know the visitor.  The other thing is the JS is populate our hidden fields with the values of query string.  We started to do this before I had a cloud component that eliminates the need for JS custom.  You can use Form Population App to do all that for you.
  • How do you use Eloqua cookies at the same time to send the form of Adwords?
    • I'm not 100% sure I know what you're asking here, but my answer to the previous question can also respond to this one.  Data search Web first checks the Eloqua cookie to retrieve your email address, and then it uses this email address to search for your Contact field values and pre-fill the form.
  • You dynamically change the landing page?
    • We're not changing dynamically the landing page.  Usually, a visitor to click through to an Eloqua email or visit a page PURL.  Dynamically present the offer page based on the value of the query string for "elqoffer."  Looking for an application Cloud released in the coming days that will allow you to place the dynamic content on this initial landing page based on your cookie.
  • The way we structure our campaigns is based on the balance between reporting requirements while maintaining their operational efficiency.  For example, we do want to create a new campaign for each offer that we have.  That would quickly overwhelm our team.  For 2013, we have created 3 campaigns:

    1 research

    2. 3rd party Emails

    3 display ads

    Each of these campaigns have only 1 formula on it (one for research, one for email and display ads).  Each offer has its own landing page (see screenshot below).  The campaign of the report combined with the data of the form layout give us the requirements we need to understand what is working and what is not.

    TIP: If you have custom data objects, you can also consider creating one that seizes all shipments form for each of your forms in 1 place.  This way, you need only 1 set of data instead of individual export for each form of export.

    Example of a search campaign:

  • TIMESTAMPADD query filter (8 weeks)

    Hi guys,.

    I can use some wisdom here on best practices to predefine a report to retrieve data for the last 8 weeks. Ideally, this will be the last week of business completed in 8 weeks. Below, is what I've gathered so far which is really Basic. Currently, when I run the report he pulls the current week 8 weeks old.

    The filter is applied as a filter of column slot, and the filtered field is [week], in the case where it makes a difference.

    TIMESTAMPADD (SQL_TSI_WEEK-8, (CURRENT_DATE))


    Another scenario, if possible, I'm looking for a way to recover the last 8 weeks, but instead should begin two weeks of the current week, and then 8 weeks back. Our SLA for some records takes a full two weeks to determine if the ALS will be achieved or missed.

    Example: If I ran the report today, I expect to recover data from 8 weeks two weeks from the current week, such as 2/21 today and the current = 18/02/13 week recovered weeks would be following weeks 24/12/12 to 04/02/2013

    All suggestions greatly appreciated ~!

    Can update you this post with the right answer?

    I would like to know it. I know how complex it is ;)

    Published by: Srini VIEREN on February 22, 2013 14:23

  • Run database query error; Help, please

    I had trouble getting this recording to publish on my DB, I have the same shape, put in place to modify an existing record, as well as the addition of a new record. I have 2 errors, can someone help me see what I'm doing wrong? I write the code that I have a problem with and two errors. I'm sorry, this is probably simple. But I looked at this code too long and miss me the problem.

    Code:
    < cfelseif ParameterExists (Form.btnEdit_OK) >

    < ParameterExists (Form.RecordID) cfif >
    < cfset eDate = DateFormat (form.eventDate, "mm/dd/yyyy") >
    "< cfquery datasource =" "#sitedatasource #" username = "#siteUserID #" password = "" #sitePassword # "dbtype ="ODBC">"
    UPDATE SEEevents
    SET SEEevents.display =' #form.display #', SEEevents.title =' #form.title #', SEEevents.eventDate ='#eDate #', SEEevents.eventTime =' #form.eventTime #', SEEevents.location =' #form.location #', SEEevents.contact =' #form.contact #', SEEevents.phone =' #form.phone #', SEEevents.fax =' #form.fax #', SEEevents.email =' #form.email #', SEEevents.URL ='#form. URL #', SEEevents.sponsor =' #form.sponsor #', SEEevents.Body ='#form. "PDSeditor #
    WHERE RecordID = #form. RecordID #.
    < / cfquery >
    < cflocation url = "events_RecordView.cfm? RecordID = #Form.RecordID # ">"
    < cfelse >
    < cfset eDate = DateFormat (form.eventDate, "mm/dd/yyyy") >
    "< cfquery datasource =" "#sitedatasource #" username = "#siteUserID #" password = "" #sitePassword # "dbtype ="ODBC">"
    INSERT INTO SEEevents (display, title, eventDate, eventTime, location, contact, telephone, fax, email, URL, sponsor, body)
    VALUES (' #form.display # "," #form.title # "," # #eDate # "," #form.eventTime # "," #form.location # "," #form.contact # "," #form.phone # "," #form.fax # "," #form.email # ', ' #form.) URL #', ' #form.sponsor # ', ' #form. PDSeditor #')
    < / cfquery >
    < cflocation url = "events_RecordView.cfm? RecordID = #GetNewRecord.ID_Field # ">"
    < / cfif >

    Here are the two errors:
    error when editing an existing record:

    Run database query error.
    [Macromedia] [SequeLink JDBC Driver] [ODBC Socket] [Microsoft] [ODBC Microsoft Access driver] Too few parameters. 1 expected.

    The error occurred in C:\websites\108392zj7\admin\events_RecordAction.cfm: line 70

    68: < cfif ParameterExists (Form.RecordID) >
    69: < cfset eDate = DateFormat (form.eventDate, "mm/dd/yyyy") >
    "70: < cfquery datasource =" "#sitedatasource #" username = "#siteUserID #" password = "" #sitePassword # "dbtype ="ODBC">"
    71: UPDATE SEEevents
    72: SET SEEevents.display =' #form.display #', SEEevents.title =' #form.title #', SEEevents.eventDate ='#eDate #', SEEevents.eventTime =' #form.eventTime #', SEEevents.location =' #form.location #', SEEevents.contact =' #form.contact #', SEEevents.phone =' #form.phone #', SEEevents.fax =' #form.fax #', SEEevents.email =' #form.email #', SEEevents.URL ='#form. URL #', SEEevents.sponsor =' #form.sponsor #', SEEevents.Body ='#form. "PDSeditor #



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

    SQL UPDATE SEEevents SET SEEevents.display = '0', SEEevents.title = 'VIP dinner', SEEevents.eventDate='04/13/2007', SEEevents.eventTime =' 8:30 pm - 23:00 ', SEEevents.location = 'person Restaurant', SEEevents.contact = 'person', SEEevents.phone ='(000) 000.6262', SEEevents.fax = ", SEEevents.email ="[email protected]", SEEevents.URL =' http://www.person.com', SEEevents.sponsor =", SEEevents.Body =' < font size = "2" face = "Verdana, Arial, Helvetica, sans serif" > < strong > Notes: facilities > bookings must be confirmed with a great Cardinal < br > < strong credit > price : < Facilities > Advance: $125. per person (including drinks and tips) at the door: $150. per person, < i > Limited places available < /i > < / police > ' WHERE RecordID = 13
    DATASOURCE ETUCE
    VENDORERRORCODE-3010
    SQLSTATE 07002

    This is the error when publishing a new record:

    Run database query error.
    [Macromedia] [SequeLink JDBC Driver] [ODBC Socket] [Microsoft] [ODBC Microsoft Access driver] Type mismatch of data in the expression of the criteria.

    The error occurred in C:\websites\108392zj7\admin\events_RecordAction.cfm: line 78

    76: < cfelse >
    77: < cfset eDate = DateFormat (form.eventDate, "mm/dd/yyyy") >
    "78: < cfquery datasource =" "#sitedatasource #" username = "#siteUserID #" password = "" #sitePassword # "dbtype ="ODBC">"
    79: INSERT IN SEEevents (display, title, eventDate, eventTime, location, contact, telephone, fax, email, URL, sponsor, body)
    80: VALUES ("#form.display #", "#form.title #", "# #eDate #", "#form.eventTime #", "#form.location #", "#form.contact #", "#form.phone #", "#form.fax #", "#form.email # ', ' #form.) URL #', ' #form.sponsor # ', ' #form. PDSeditor #')



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

    SQL INSERT INTO SEEevents (display, title, eventDate, eventTime, location, contact, telephone, fax, email, URL, sponsor, body) VALUES ('0 ', 'test', ' # #03/25/2007 ", 12:47 ', 'Home', 'CJD', '' 000-000-0000,", '[email protected]', 'www.saratogaexpo.com', ' ', ' ')
    DATASOURCE ETUCE
    VENDORERRORCODE-3030
    SQLSTATE 22018

    Can someone help me tweek this code? I see double at this stage. Thank you.

    Phoenix

    I thought about it. It's a java tag used by my editor throwing the error in the backup / update of the function.

    Thanks a lot for all the help everyone!
    If I can ever help anyone in any way, feel free to ask.

  • Need help with the query. Help, please

    Hey everyone, need your help.  Thank you in advance.  In my view, there is function Pivot.  Just do not know how to use this function.  I have the query that works.  The result is:

    11-111-1111 Vlad 16505 01/04/2013 5 August 13 dental plan pre-tax amount 29,65

    11-111-1111 Vlad 16505 01/04/2013 dental pre-tax 5 August 13 Plan level EE + SP

    11-111-1111 16505 Vlad 01/04/2013 5 August 13 pre-tax Option TOP dental plan

    11-111-1111 Vlad 16505 01/04/2013 5 August 13 pre-tax dental care plan pay the value

    11-111-1111 16505 Vlad 01/04/2013 dental pre-tax 5 August 13 Plan period Type

    11-111-1111 Vlad 16505 01/04/2013 amount pre-tax medical Plan of 5 August 13 149

    11-111-1111 Vlad 16505 01/04/2013 5 August 13 pre-tax Medical Plan level EE + SP

    11-111-1111 Vlad 16505 01/04/2013 5 August 13 pre-tax Plan medical Option MED

    11-111-1111 Vlad 16505 01/04/2013 5 August 13 plan pre-tax pay value

    11-111-1111 16505 Vlad 01/04/2013 5 August 13 pre-tax Medical Plan period Type

    11-111-1111 Vlad 16505 01/04/2013 5 August 13 pre-tax Plan PPO medical Plan

    11-111-1111 Vlad 16505 01/04/2013 5 August 13 Vision Plan amount 5.94 pre-tax

    But I need the result to be

    Amount of SSN ID name item level Option PayValue period Type

    11-111-1111 Vlad 16505 01/04/2013 null null high of 5 August 13 pre-tax Dental Plan 29,65 EE + SP

    11-111-1111 Vlad 16505 01/04/2013 null null MED 5 August 13 149 medical plan pre-tax EE + SP

    11-111-1111 Vlad 16505 01/04/2013 Vision Plan before taxes of 5 August 13

    Select distinct
    ' 11-111-1111 "as ssn,
    WOMEN'S WEAR. Employee_number,
    "Vlad" as EMPLOYEE_FULL_NAME,
    TO_CHAR (papf.start_date, "MM/DD/YYYY") as Date_Of_Hire
    a.effective_start_date,
    PETF.element_name,
    pivf. Name,
    peevf.screen_entry_value

    Of
    PER_all_PEOPLE_F women's wear
    per_assignments_f A
    pay_element_types_f petf
    pay_element_links_f pelf
    PAY_ELEMENT_ENTRIES_F penf
    PAY_ELEMENT_ENTRY_VALUES_F peevf
    pay_input_values_f pivf
    WHERE
    PETF.element_name ('Dental Plan before taxes', 'Medical Plan before taxes', "Vision Plan before taxes")
    and petf. ELEMENT_TYPE_ID = pelf. ELEMENT_TYPE_ID
    and (trunc (sysdate) BETWEEN pelf. EFFECTIVE_START_DATE AND pelf. EFFECTIVE_END_DATE)
    and (pelf. ELEMENT_LINK_ID = penf. ELEMENT_LINK_ID and a.assignment_id = penf. ASSIGNMENT_ID)
    and (trunc (sysdate) BETWEEN penf. EFFECTIVE_START_DATE AND penf. EFFECTIVE_END_DATE)
    and penf. ELEMENT_ENTRY_ID = peevf. ELEMENT_ENTRY_ID
    and peevf. INPUT_VALUE_ID = pivf. INPUT_VALUE_ID
    AND papf.employee_number IS NOT NULL
    AND A.assignment_type = 'E '.
    AND A.person_id = papf.person_id
    and papf.effective_end_date > sysdate
    and a.effective_end_date > sysdate
    and (trunc (sysdate) BETWEEN women's wear. EFFECTIVE_START_DATE AND women's wear. EFFECTIVE_END_DATE)
    and a.effective_start_date = (select MAX (effective_start_date) from PER_ASSIGNMENTS_f where assignment_id = a.assignment_id)
    and a.assignment_id = 42643
    and a.assignment_status_type_id = '1'
    order of petf.element_name;

    Change with your query

    SELECT * FROM (select distinct)

    ' 11-111-1111 "as ssn,

    WOMEN'S WEAR. Employee_number,

    "Vlad" as employee_full_name,

    TO_CHAR (papf.start_date, "MM/DD/YYYY") as date_of_hire

    a.effective_start_date,

    PETF.element_name,

    pivf. Name,

    peevf.screen_entry_value

    Of

    PER_all_PEOPLE_F women's wear

    per_assignments_f A

    pay_element_types_f petf

    pay_element_links_f pelf

    PAY_ELEMENT_ENTRIES_F penf

    PAY_ELEMENT_ENTRY_VALUES_F peevf

    pay_input_values_f pivf

    WHERE

    PETF.element_name ('Dental Plan before taxes', 'Medical Plan before taxes', "Vision Plan before taxes")

    and petf. ELEMENT_TYPE_ID = pelf. ELEMENT_TYPE_ID

    and (trunc (sysdate) BETWEEN pelf. EFFECTIVE_START_DATE AND pelf. EFFECTIVE_END_DATE)

    and (pelf. ELEMENT_LINK_ID = penf. ELEMENT_LINK_ID and a.assignment_id = penf. ASSIGNMENT_ID)

    and (trunc (sysdate) BETWEEN penf. EFFECTIVE_START_DATE AND penf. EFFECTIVE_END_DATE)

    and penf. ELEMENT_ENTRY_ID = peevf. ELEMENT_ENTRY_ID

    and peevf. INPUT_VALUE_ID = pivf. INPUT_VALUE_ID

    AND papf.employee_number IS NOT NULL

    AND A.assignment_type = 'E '.

    AND A.person_id = papf.person_id

    and papf.effective_end_date > sysdate

    and a.effective_end_date > sysdate

    and (trunc (sysdate) BETWEEN women's wear. EFFECTIVE_START_DATE AND women's wear. EFFECTIVE_END_DATE)

    and a.effective_start_date = (select MAX (effective_start_date) from PER_ASSIGNMENTS_f where assignment_id = a.assignment_id)

    and a.assignment_id = 42643

    and a.assignment_status_type_id = '1')

    PIVOT (MAX (screen_entry_value) FOR (name) TO ("Amount" AS 'Amount', 'level' AS 'level', 'Option High' AS 'High Option', 'Pay the value' AS 'Value to pay', 'Period of Type' AS 'Type period'))

    order by element_name;

    (GOLD)

    SELECT ssn,

    Employee_number,

    employee_full_name,

    date_of_hire,

    effective_start_date,

    element_name,

    Max (decode (Name, 'Amount', screen_entry_value)) 'amount. "

    Max (decode (Name, 'Level', screen_entry_value)) 'level ',.

    MAX (DECODE (name, "High Option", screen_entry_value)) "High Option",

    MAX (DECODE (name, 'Value of pay', screen_entry_value)) 'value of pay. "

    MAX (DECODE (name, 'Period Type', screen_entry_value)) 'period of Type '.

    FROM (select distinct)

    ' 11-111-1111 "as ssn,

    WOMEN'S WEAR. Employee_number,

    "Vlad" as employee_full_name,

    TO_CHAR (papf.start_date, "MM/DD/YYYY") as date_of_hire

    a.effective_start_date,

    PETF.element_name,

    pivf. Name,

    peevf.screen_entry_value

    Of

    PER_all_PEOPLE_F women's wear

    per_assignments_f A

    pay_element_types_f petf

    pay_element_links_f pelf

    PAY_ELEMENT_ENTRIES_F penf

    PAY_ELEMENT_ENTRY_VALUES_F peevf

    pay_input_values_f pivf

    WHERE

    PETF.element_name ('Dental Plan before taxes', 'Medical Plan before taxes', "Vision Plan before taxes")

    and petf. ELEMENT_TYPE_ID = pelf. ELEMENT_TYPE_ID

    and (trunc (sysdate) BETWEEN pelf. EFFECTIVE_START_DATE AND pelf. EFFECTIVE_END_DATE)

    and (pelf. ELEMENT_LINK_ID = penf. ELEMENT_LINK_ID and a.assignment_id = penf. ASSIGNMENT_ID)

    and (trunc (sysdate) BETWEEN penf. EFFECTIVE_START_DATE AND penf. EFFECTIVE_END_DATE)

    and penf. ELEMENT_ENTRY_ID = peevf. ELEMENT_ENTRY_ID

    and peevf. INPUT_VALUE_ID = pivf. INPUT_VALUE_ID

    AND papf.employee_number IS NOT NULL

    AND A.assignment_type = 'E '.

    AND A.person_id = papf.person_id

    and papf.effective_end_date > sysdate

    and a.effective_end_date > sysdate

    and (trunc (sysdate) BETWEEN women's wear. EFFECTIVE_START_DATE AND women's wear. EFFECTIVE_END_DATE)

    and a.effective_start_date = (select MAX (effective_start_date) from PER_ASSIGNMENTS_f where assignment_id = a.assignment_id)

    and a.assignment_id = 42643

    and a.assignment_status_type_id = '1')

    GROUP BY ssn, employee_number, employee_full_name, date_of_hire, effective_start_date, NOM_ELEMENT

    order by element_name;

  • I keep hearing in the background ads. Need help with a few good Adware/Malware removers please.

    I tried Microsoft Essentials and Microsoft Security Scanner.  I tried on WIndows Defender, but I can not turn on, so I can run the software.  Initially, I had run SSM, and he had said that I had some Adware on my PC and he had kidnapped, but yet I still see ads in my headphones.  I reinstalled my Windows and fixed my start-up problems so that comes to be just in case anyone is curious.  Any help would be greatly appreciated, thanks guys and girls!

    Thank you, Tommy, I used this link http://support.kaspersky.com/5350?el=88446 that John had already posted.  I ran, and he immediately found the bat.  Corrected the issue and no problem now.  Thanks again John! If I end up finding more problems persitant I also give these steps to try.  Thanks again you two for help!

  • Query related looking for an invalid file name or a folder after scanning with shield system

    Original title: how to find a folder or a filename not valid?

    I my says Iolo System Shield 4 cases of invalid file names or records, but does not show me where they are.  How can I find them so I can delete them?  I'm afraid that they might cause my computer to break and restart all of a sudden.  Thank you!

    Hello

    You need Contact Lolo support for assistance.

    http://support.iolo.com/ICS/support/splash.asp

    Hope this information helps.

  • Addition of several xml using Insertxmlbefore in a single query. Help, please.

    Oracle version

    Oracle Database 11 g Enterprise Edition Release 11.2.0.4.0 - 64 bit Production

    PL/SQL Release 11.2.0.4.0 - Production

    CORE Production 11.2.0.4.0

    AMT for Linux: Version 11.2.0.4.0 - Production

    NLSRTL Version 11.2.0.4.0 - Production

    I have an xml where I need to insert a new xml basedupon the partyID.

    for each partyid in the need to xmoutput to insert representative data.

    with t as (
    select 1 source_no , xmltype('<report>
                       <partyReported partyId="1">
                         <name> TEST123</name>
                      </partyReported>
                      <partyReported partyId="2">
                         <name> TEST456</name>
                      </partyReported>
                   </report>')
                   xmloutput
                   from dual
                )
              ,
              t_member as (
               select 1 candidate_no, xmltype('<Representative>
                                           <name> rep123 </name>
                                  </Representative>') rep_xml from dual
              union all
              select 2 , xmltype('<Representative>
                                           <name> rep456 </name>
                                  </Representative>') from dual
            )
            , t_rep_member as(
            SELECT
              source_no
            , X.*
            , xmloutput
         FROM
              t
            , XMLTABLE ('/report/partyReported' passing xmloutput COLUMNS candidate_no INTEGER PATH '@partyId', candidate_idx FOR ordinality ) AS X
         )
         , all_data
         as (
         select sourcE_no, a.candidate_no, xmloutput, rep_xml from t_rep_member a, t_member b
         where a.candidate_no = b.candidate_no
         )
         select source_no, MergeRepXml(repxml(candidate_no,rep_xml,xmloutput)) final_xml from all_data
         group by sourCe_no;
    
    

    source_no, candidate_no, candidate_idx, xmloutput
    
    1    1    1    "<report>                   <partyReported partyId="1">                     <name> TEST123</name>                  </partyReported>                   <partyReported partyId="2">                     <name> TEST456</name>                  </partyReported>                </report>"
    1    2    2    "<report>                   <partyReported partyId="1">                     <name> TEST123</name>                  </partyReported>                   <partyReported partyId="2">                     <name> TEST456</name>                  </partyReported>                </report>"
    
    
    
    

    I solved this problem, but I get an error message when I try to do 1000 of them.

    ERROR:

    ORA-22813: value of the operand is greater than the limits of the system

    create or replace
    type RepXml as object( candidate_no number, rep_xml xmltype, output xmltype)
    /
    create or replace
    type RepXmltab as table of RepXml
    /
    
    
    
    
    
    create or replace
    type MERGEREP as object
    (
      -- string varchar2(4000),                  -- deleted
      val_table  RepXmltab ,           -- added
    
    
      static function ODCIAggregateInitialize
        ( sctx in out MERGEREP )
        return number ,
    
      member function ODCIAggregateIterate
        ( self  in out MERGEREP ,
          value in     RepXml
        ) return number ,
    
      member function ODCIAggregateTerminate
        ( self        in  MERGEREP,
          returnvalue out xmltype,
          flags in number
        ) return number ,
    
      member function ODCIAggregateMerge
        ( self in out MERGEREP,
          ctx2 in     MERGEREP
        ) return number
    );
    
    
    create or replace
    type body MERGEREP
    is
    
      static function ODCIAggregateInitialize
      ( sctx in out MERGEREP )
      return number
      is
      begin
    
         sctx := MERGEREP( repxmltab(null,null,null) );
         --val_table:= repxmltab(null);
    
        return ODCIConst.Success ;
    
      end;
    
      member function ODCIAggregateIterate
      ( self  in out MERGEREP ,
        value in     RepXml
      ) return number
      is
      begin
    
        self.val_table.extend;
        self.val_table(self.val_table.count) := value;
    
        return ODCIConst.Success;
      end;
    
      member function ODCIAggregateTerminate
      ( self        in  MERGEREP ,
        returnvalue out xmltype ,
        flags       in  number
      ) return number
      is
    
        v_data  xmltype ;
    
      begin
    
    v_data:= null;
    
    for x in (
         select candidate_no,rep_xml,output
          from   table(val_table)
          )
          loop
          v_data:= x.output;
    
          end loop;
               
       
        for x in
        (
    select candidate_no,rep_xml,output
          from   table(val_table)
          )
        loop
        select insertxmlbefore(v_data,'/report/partyReported[@partyId="'||x.candidate_no||'"]', x.rep_xml) into v_data from dual;
    null;
        end loop;
    
        returnValue := ( v_data) ;
    
    v_data:= null;
    
        return ODCIConst.Success;
    
      end;
    
      member function ODCIAggregateMerge
      ( self in out MERGEREP ,
        ctx2 in     MERGEREP
      ) return number
      is
      begin
    
        for i in 1 .. ctx2.val_table.count
        loop
          self.val_table.extend;
          self.val_table(self.val_table.count) := ctx2.val_table(i);
        end loop;
    
    
    
        return ODCIConst.Success;
    
            end;
      end;
    /
    
    create or replace
    function MergeRepXml
      ( input RepXml )
      return xmltype
      deterministic
      parallel_enable
      aggregate using MERGEREP
    ;
    /
    
    

    With my limited knowledge, I tried to write recursive with clause and achieve the expected results, but many lines are displayed.

    WITH
         t1 AS
         ( SELECT * FROM aps_extendedoutput WHERE source_no = 261177
         )
         --     select * from t1;
       , t AS
         (SELECT
              source_no
            , X.*
            , xmloutput
         FROM
              t1
            , XMLTABLE ('/report/role/partyReported' passing xmloutput COLUMNS candidate_no INTEGER PATH '@partyId', candidate_idx FOR ordinality ) AS X
         )
         --     select * from t;
       , all_data AS
         (SELECT
              /*+ materialize */
              t.candidate_no
            , rep_xml
            , source_no
            , t.candidate_no
            , xmloutput
         FROM
              t
            , aps_reppartyxml t_p
         WHERE
              t.candidate_no = t_p.candidate_no
         )
         --   select * from all_data;
       ,recursive_data(candidate_i, xmloutput, source_no, candidate_no) AS
         (SELECT
              1 candidate_i
              , xmloutput
            ,  source_no
            , 0 candidate_no
         FROM
             t1
         UNION ALL
         SELECT
              candidate_i + 1
              , insertxmlbefore(rd.xmloutput,'/report/role/partyReported[@partyId="'
              ||ad.candidate_no
              ||'"]', ad.rep_xml) xmloutput
            , ad.source_no
            , rd.candidate_no
         FROM
              all_Data ad
            , recursive_data rd
         WHERE
              ad.sourcE_no        = rd.source_no and
               candidate_i     < 3
         )
    SELECT *  FROM recursive_data;
    
    

    for example

    SQL> create table t_member as (
      2  select 1 candidate_no, xmltype('
      3                                rep123 
      4                      ') rep_xml from dual
      5  union all
      6  select 2 , xmltype('
      7                                rep456 
      8                      ') from dual
      9  );
    
    Table created.
    
    SQL>
    SQL> set long 5000
    SQL>
    SQL> with t (source_no, xmloutput) as (
      2    select 1
      3         , xmltype('
      4                      
      5                          TEST123
      6                      
      7                      
      8                          TEST456
      9                      
     10                   ')
     11    from dual
     12  )
     13  select t.source_no
     14       , xmlserialize(document
     15           xmlquery(
     16             'copy $d := .
     17              modify (
     18                for $i in $d/report/partyReported
     19                  , $j in fn:collection("oradb:/DEV/T_MEMBER")/ROW
     20                where $j/CANDIDATE_NO = $i/@partyId
     21                return insert node $j/REP_XML/* before $i
     22              )
     23              return $d'
     24             passing t.xmloutput
     25             returning content
     26           )
     27           indent
     28         ) as final_xml
     29  from t ;
    
     SOURCE_NO FINAL_XML
    ---------- --------------------------------------------------------------------------------
             1 
                 
                    rep123 
                 
                 
                    TEST123
                 
                 
                    rep456 
                 
                 
                    TEST456
                 
               
    
  • Box for mysql query filter

    SO I created a combination of research and results page which works very well.  In the database, I have a Boolean variable that determines if the record is active.  I want to include a check box on the search form that returns only active records.  A little hard.  Here is the code:

    <? php require_once('Connections/testmypms.php');? >

    <? PHP

    $currentPage = $_SERVER ['PHP_SELF'];

    $maxRows_demographics = 10;

    $pageNum_demographics = 0;

    If (isset($_GET['pageNum_demographics'])) {}

    $pageNum_demographics = $_GET ['pageNum_demographics'];

    }

    $startRow_demographics = $pageNum_demographics * $maxRows_demographics;

    $vardemid_demographics = '% ';

    If (isset($_POST['schDemID'])) {}

    $vardemid_demographics = (get_magic_quotes_gpc())? $_POST ['schDemID']: addslashes($_POST['schDemID']);

    }

    $vardemfirstname_demographics = '% ';

    If (isset($_POST['schDemFirstname'])) {}

    $vardemfirstname_demographics = (get_magic_quotes_gpc())? $_POST ['schDemFirstname']: addslashes($_POST['schDemFirstname']);

    }

    $vardemsurname_demographics = '% ';

    If (isset($_POST['schDemSurname'])) {}

    $vardemsurname_demographics = (get_magic_quotes_gpc())? $_POST ['schDemSurname']: addslashes($_POST['schDemSurname']);

    }

    $vardemactive_demographics = "1";

    If (isset($_POST['schActive'])) {}

    $vardemactive_demographics = (get_magic_quotes_gpc())? $_POST ['schActive']: addslashes($_POST['schActive']);

    }

    @mysql_select_db ($database_testmypms, $testmypms);

    $query_demographics = sprintf ("SELECT demographics.px_id, demographics.firstname, demographics.surname, demographics.address1, demographics.address2, demographics.town, demographics.postcode, title.title, demographics.active FROM demographics, title demographics WHERE.") ("FK_title_id = title.title_id AND demographics.px_id AS ' %s %' AND demographics.firstname AS ' %s %% ' AND demographics.surname AS ' %s %' ORDER BY demographics.surname an AND demographics.active='%s, demographics.firstname ', $vardemid_demographics, $vardemfirstname_demographics, $vardemsurname_demographics, $vardema ctive_demographics);

    $query_limit_demographics = sprintf ("%s LIMIT %d, %d", $query_demographics, $startRow_demographics, $maxRows_demographics);

    $demographics = mysql_query ($query_limit_demographics, $testmypms) or die (mysql_error ());

    $row_demographics = mysql_fetch_assoc ($demographics);

    If (isset($_GET['totalRows_demographics'])) {}

    $totalRows_demographics = $_GET ['totalRows_demographics'];

    } else {}

    $all_demographics = mysql_query ($query_demographics);

    $totalRows_demographics = mysql_num_rows ($all_demographics);

    }

    $totalPages_demographics = ceil($totalRows_demographics/$maxRows_demographics)-1;

    $queryString_demographics = "";

    If (! empty($_SERVER['QUERY_STRING'])) {}

    $params = explode ("&", $_SERVER ['QUERY_STRING']);

    $newParams = array();

    {foreach ($params as $param)

    If (stristr ($param, "pageNum_demographics") == false & &)

    stristr ($param, "totalRows_demographics") == false) {}

    return ($newParams, $param);

    }

    }

    If (count ($newParams)! = 0) {}

    $queryString_demographics = '& '. htmlentities (implode ("&", $newParams));

    }

    }

    $queryString_demographics = sprintf ("& totalRows_demographics = %d %s", $totalRows_demographics, $queryString_demographics);

    ? >

    < ! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional / / IN" "http://www.w3.org/TR/html4/loose.dtd" > ""

    < html >

    < head >

    < meta http-equiv = "Content-Type" content = text/html"; charset = iso-8859-1 ">"

    < title > Search < /title >

    < / head >

    < body >

    Search Patient < p > < /p >

    < do action = "" method = "post" name = "schDem" id = "schDem" > "

    < table border = "1" cellspacing = "1" cellpadding = "5" >

    < b >

    ID < td > < table >

    < td > < input name = "schDemID" type = 'text' id = 'schDemID' > < table >

    < td > < table >

    < /tr >

    < b >

    FirstName < td > < table >

    < td > < input name = "schDemFirstname" type = 'text' id = 'schDemFirstname' > < table >

    < td > < table >

    < /tr >

    < b >

    last name < td > < table >

    < td > < input name = "schDemSurname" type = 'text' id = 'schDemSurname' > < table >

    < td > assets show only

    < input name = "schActive" type = "checkbox" id = "schActive" value = "0" checked > < table >

    < /tr >

    < b >

    < td > < table >

    < td > < input name = "Search" type = "submit" id = "Search" value = "Search" > < table >

    < td > < table >

    < /tr >

    < /table >

    < / make >

    < p > < a href = "<?" PHP printf ("%s? (pageNum_demographics = %d %s", $currentPage, max (0, $pageNum_demographics - 1), $queryString_demographics);? > "> previous < /a > < a href =" <? PHP printf ("%s? (pageNum_demographics = %d %s", $currentPage, min ($totalPages_demographics, $pageNum_demographics + 1), $queryString_demographics);? > "> Next < /a > < /p >"

    < table border = "1" >

    < b >

    px_id < td > < table >

    title < td > < table >

    FirstName < td > < table >

    last name < td > < table >

    address1 < td > < table >

    address2 < td > < table >

    < td > city < table >

    < Td > < table > zip code

    < /tr >

    <? PHP {? >}

    < b >

    < td > < a href = "main.php? pxID = <?" PHP echo $row_demographics ["px_id"];? > "> <?" PHP echo $row_demographics ["px_id"];? > < /a > < table >

    < td > <? PHP echo $row_demographics ['title'];? > < table >

    < td > <? PHP echo $row_demographics ["FirstName"];? > < table >

    < td > <? PHP echo $row_demographics ['name'];? > < table >

    < td > <? PHP echo $row_demographics ['Address1'];? > < table >

    < td > <? PHP echo $row_demographics ["address2"];? > < table >

    < td > <? PHP echo $row_demographics ['city'];? > < table >

    < td > <? PHP echo $row_demographics ['postal code'];? > < table >

    < /tr >

    <? PHP} while ($row_demographics = mysql_fetch_assoc ($demographics));? >

    < /table >

    < / body >

    < / html >

    <? PHP

    mysql_free_result ($Demographics);

    ? >

    Any suggestion would be great

    Thank you

    This is because your logic is reversed. You should show the default value of 0 (zero) and then a value of 1 if it is defined. Try this

    $vardemactive_demographics = 0;

    If (isset($_POST['schActive'])) {}

    $vardemactive_demographics = 1;

    }

Maybe you are looking for

  • An update is available for voice mail

    If I get a notification that there is an update for the program of voicemail. When I press the update, it says "Voicemail app updated" and will then quickly to "sorry, a problem update checking. Can't seem to make it go. I tried on WiFi and 3G

  • What lens for all around wildlife?

    Hi, I'm new here. I shoot with an EOS 6 d and photo anything birds in flight to rattlesnake coiled on the ground. I'm looking for a good lens versatile and heavy leaning to the EF 100-400mm F4. 5-5.6 L IS II USM.  I also usually do not use my tripod,

  • I keep getting error 651 trying to make a wired connection

    original title: I keep getting error 651 I keep getting error 651. I replaced the system of rasPPPeO several times with a workgroup file in Vista and still no connection. After the file system is replaced, I get a new icon in a wide area network wan

  • Spotify on Walkman?

    Hello. So I continue to receive messages from Sony by telling me that unlimited reverie service will close and Spotify will take his place. 3 weeks left and I'm unable to find information about how the transition will happen. My biggest concerns are:

  • The module "mscomctl.ocx" was loaded but the call to DllRegisterServer failed with error 0x8002801c code.

    Software Access 2003 worked for years. Then received "There is no object in this control" which referred to a control in mscomctl.ocx I used in a form. Then, I got an error, "There was a problem accessing a property or method of the OLE object.".  Th