Punch to deal with reviews

I have request posted by Boneist

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

with tsht_punchdata1 as (select 1 employee_id, to_date (February 24, 2011 08:55 ',' dd/mm/yyyy hh24 ') punchdate, 1 punchinout of all the double union)

Select 1 employee_id, to_date (February 24, 2011 08:56 ',' dd/mm/yyyy hh24 ') punchdate, 1 punchinout of all the double union

Select 1 employee_id, to_date (February 24, 2011 16:20 ',' dd/mm/yyyy hh24 ') punchdate, 0 punchinout of all the double union

Select 1 employee_id, to_date (February 26, 2011 16:14 ',' dd/mm/yyyy hh24 ') punchdate, 1 punchinout of all the double union

Select 1 employee_id, to_date (27 February 2011 16:15 ',' dd/mm/yyyy hh24 ') punchdate, 0 punchinout of all the double union

Select 1 employee_id, to_date (March 3, 2011 08:20 ',' dd/mm/yyyy hh24 ') punchdate, 1 punchinout of all the double union

Select 1 employee_id, to_date (March 3, 2011 16:23 ',' dd/mm/yyyy hh24 ') punchdate, 0 punchinout of double

),

RES in the (select employee_id,

punchdate,

punchinout,

(punchinout, 1, 1) ahead of next_punchinout (partition by employee_id order punchdate).

When cases in advance (punchinout, 1, 1) over (partition by employee_id) stopped by punchdate = 0 and punchinout = 1

then punchdate

When lead (punchinout, 1, 1) over (partition by employee_id arrested by punchdate) = 1 and punchinout = 1

then punchdate

When lead (punchinout, 1, 1) over (partition by employee_id arrested by punchdate) = 0 and punchinout = 0

then null

end punch_in

When cases in advance (punchinout, 1, 1) over (partition by employee_id) stopped by punchdate = 0 and punchinout = 1

then lead (punchdate) over (partition by employee_id arrested by punchdate)

When lead (punchinout, 1, 1) over (partition by employee_id arrested by punchdate) = 1 and punchinout = 1

then null

When lead (punchinout, 1, 1) over (partition by employee_id arrested by punchdate) = 0 and punchinout = 0

then lead (punchdate) over (partition by employee_id arrested by punchdate)

end punch_out

of tsht_punchdata1).

dummy_dates as (select to_date (February 21, 2011 ', ' dd/mm/yyyy')-1 + level dt)

of the double

connect by level < = to_date (March 20, 2011 ', ' dd/mm/yyyy')-to_date (February 21, 2011 ', ' dd/mm/yyyy') + 1).

Select to_char (dd.dt, ' dd/mm/yyyy') punch_date,.

Res.Employee_ID,

-case when res.punch_in < dd.dt then to_char (dd.dt, ' dd/mm/yyyy hh24')

of another to_char (res.punch_in, ' dd/mm/yyyy hh24')

end punch_in

When case trunc (res.punch_out) > dd.dt then to_char (dd.dt + 1, ' dd/mm/yyyy hh24')

of another to_char (res.punch_out, ' dd/mm/yyyy hh24')

end punch_out

of dummy_dates dd

legacy partition res outer join (employe_id)

on ((dd.dt between trunc (coalesce(res.punch_in, res.punch_out))

and trunc (coalesce(res.punch_out, res.punch_in)))

and not (res.punchinout = 0 and res.next_punchinout = 1))

employe_id order, dd.dt;

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

I want to get a punch of above data anomaly report.

That is to say. only the dates for which there is no punch must be posted. Also the punch must not be cut into different dates.

Here, the result would be...

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

EMPLOYE_ID PUNCH_IN PUNCH_OUT

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

1 24/02/2011-08:55 < NULL >

1 24/02/2011 08:56 02/24/2011 16:20

1 26/02/2011 16:14 27/02/2011 16:15 (not cut in two)

1 3/3/2011 08:20 3/3/2011 16:23

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

Please provide me with the request and I want to save this sql as the view in the name of "Punchtoprocess".

I want the result of the first query (for all dates between two given dates and shares also at different dates.) by querying the view of "Punchtoprocess", tsht_punchdata, table etc...

is this possible?

Hello

Here's one way:

WITH got_r_num AS

(

SELECT employe_id, punchdate, punchinout

, ROW_NUMBER () OVER (PARTITION BY employee_id - just guessing

ORDER BY punchdate

) AS r_num

OF tsht_punchdata1

)

SELECT employee_id NVL (i.employee_id, o.employee_id)

i.punchdate AS punch_in

o.punchdate AS punch_out

Got_r_num I have

FULL OUTER JOIN got_r_num o ON o.employee_id = i.employee_id

AND o.r_num = i.r_num + 1

AND o.punchinout <> i.punchinout

WHERE i.punchinout = 1

OR o.punchinout = 0

ORDER OF NVL (i.employee_id, o.employee_id)

NVL (punch_in, punch_out)

;

To give an opinion, simply add "CREATE OR REPLACE VIEW view-name AS" at the beginning and omit the ORDER BY clause:

VIEW to CREATE or REPLACE pucntoprocess

AS

WITH got_r_num AS

...

WHERE i.punchinout = 1

OR o.punchinout = 0

;

Tags: Database

Similar Questions

  • I forgot my password for apple and have permission to stage the 2 and broken my old phone and do not have the same number of what I can do my account is already waiting to be reset, but it takes apple long to to deal with the what else is there to do?

    I forgot my password for apple and have permission to stage the 2 and broken my old phone and do not have the same number of what I can do my account is already waiting to be reset, but it takes apple long to to deal with the what else is there to do?

    You know the e-mail password what do you use? I lost over $ 30 on my old Apple ID because I couldn't get into the email and apple would not transfer my money to my new account.

  • How can I copy recipients of a letter sent in a fresh mail I have to deal with some of the deleted recipients?

    I want to be able to select the recipients of a new mail from a mail sent. I want to be able to copy some of the recipients of those previous mail, but not all. Is there a simple way to copy all the old recipients in a single operation, and then selecting some recipients to delete in one operation?

    jazzebel2 said

    My original question remains: how to remove some of the recipients at once? Is it possible to deselect say's five recipients on 20 without each of them manually and detached, one at a time?

    Really, I've had dealing with the situation that you have described. I don't think it's possible with current TB. You may request a feature on Bugzilla request.
    https://Bugzilla.Mozilla.org/

  • 100 requests to continue POST deal with error in Firefox 24

    BUG Firefox 24!
    24 Firefox manages POST requests with the error: when 100 continue answers are preceded by 200 OK response, and then Firefox does not deal with other responses (including 200 OK response) after receipt of the response to continue first 100.
    Earlier versions more handle 100 continue properly.

    I'm sorry, I tested my script with Mozilla Firefox 25 - was the same problem. But then I spilled http connection - the newspaper said then 100 response continues and 100 OK data are mixed and gzip'ped. Then I disable deflate module for my Apache Server - and all become Okey! So, I just disable the compaction modules incorrect return data to solve the problem. Web server: apache2-mpm-itk on Debian Linux winded 7.

  • ITunes has stolen my music from my computer. Because they do not want to deal with the public, what should I do to get back them.

    Every so often, iTunes sends a notice to update the iTunes on my computer. Last year after that they did, all sounds have disappeared from my list of reading hundreds of old songs. Now, when I click on any song or melody, nothing happens.

    Given that Apple does not want to deal with the public, I ask, what do I do now, please?

    See the empty/corrupted after upgrade/crash iTunes library. Ideally, the measures taken immediately after that the problem appeared would restore your library. In some cases your media may be still on the computer, but not when iTunes is looking to it. The songs that do not play show with an exclamation point in the view of songs? ITunes plays all audio signal at all?

    TT2

  • Continuing to grow/expand my limits: dealing with overflow

    I have a strange situation with a sensor that I hope you guys can help me with...

    I have a 16-bit binary value out of a chip.  I can read this quite well, but from time to time the signal has a behavior of infinity (from values near near 65535 values 0 close in a reading and vice versa). This is due to the chip and not BT reading problems, and I don't see all the settings in order to adjust it on the side of the chip...

    I wonder if there are strategies to deal with this on how to interpret the data.  Ideally, I would just change the low values up, but I can't find how reliable to apply.  I thought that the signal dropped to 2 ^ 15, which would be a pretty big indicator; I have no feeling if it is "legitimate".

    Thanks for any thoughts!

    If it's the acceleration, how your arm 'rest' can the axes y and z and x, accelerations, showing constant? How your acceleration will never be positive and negative ever?

    It does not explain what your graphic example, but if as you have already said you see numbers ranging from 65535 to near zero, it could be that you are a reading I16 and somehow castant or misinterpretation it like a U16.

    Then, for a noisy signal around zero,

    Cast-1 to U16 I16 gives 65535

    I16 cast 0 to U16 gives 0

  • I do not want to promote the material for your business but I don't know how to do this. Could I be put in contact with the one dealing with promotion of contact microsoft or microsoft studios.

    Dear, that which which may concern,.

    I do not want to promote the material for your business but I don't know how to do this. Could I be put in contact with the one dealing with promotion of contact from microsoft, or microsoft studios, anyone who takes care of the halo franchise.

    Hello

    Microsoft - unsolicited ideas
    http://www.Microsoft.com/en-us/legal/intellectualproperty/copyright/default.aspx#O14

    343 industries manage Halo - check community and forums
    https://www.halowaypoint.com/en-us

    I hope this helps.
    --------------------------------------------------------------------------------------------
    Rob Brown - Microsoft MVP<- profile="" -="" windows="" experience :="" bicycle="" -="" mark="" twain="" said="" it="">

  • How to deal with analysis PC Performance & Stability Report

    Yesterday, when I just walked into my Office Xp, an error report in a program called... uh, PC Performance & Stability Report analysis, can possibly be, telling me to correct these errors have shown under its professional service.
    How to deal with him?
    Thank you for your advice it.

    Hello MeriClaybron,

    1. have you installed any show analyzing the program on your computer?

    This problem can be caused due to infection by the Virus. I suggest that you run a virus scan on your computer using Microsoft Safety scanner and check if you have the same problem.

    http://www.Microsoft.com/security/scanner/en-us/default.aspx

  • Can't deal with calibri 11 pt font?

    I use windows mail and vista64, have my tools-options-dial-mail police calibri 11 PT. the value. I do not use any mail stationary and sent in HTML format.

    When writing email, my default 10-point calibri font settings. as soon as I click in the area of publication (according to the font drop-down list above the body of the email). If I have access to this drop-down list, my options are only 8, 10, 12, 14 pt... etc. How can I deal with font size I want? OK, I know I'm obsessed, but unfortunately, it's just me :))

    Help much appreciated.

    Jeff

    You can do this:

    test

    or even better:

    whatever

    or you can set all of the police force:

    whatever

    Steve

  • Apparently, my memory is almost full - no idea how to deal with not having a novice such am - sd card

    Apparently, my memory is almost full - no idea how to deal with not having a novice such am - sd card

    Hi sixty.

    It can also be a good idea to begin to transfer the content from your phone to a PC/Mac to help reduce the storage room.

    It is a process usually easy, just plug the unit to a PC, on the phone screen select MTP mode when it appears.

    Once finished, you just have to access the phone's internal memory and transfer pictures/videos from the DCIM folder.

    Let us know if you need help in this kind of task.

  • My network password box keeps coming back, and does not deal with e-mail.

    network password box problem

    My network password box keeps coming back and does not deal with e-mail, this just started happening, why

    Hello

    ·         What mail client do you use?

    ·         Were there any changes made on the computer before the show?

    ·         Are you making reference to the box to pop up while accessing an e-mail program like Windows mail or Outlook?

    Please provide us with more information about the issue so that we can help you further:

    If you are facing this problem on Outlook, see this link:

    http://Office.Microsoft.com/en-us/Outlook-help/i-get-an-enter-network-password-prompt-HA010151354.aspx

    Alternatively, you can ask the experts in the forums of Outlook:

    http://answers.Microsoft.com/en-us/Office/Forum/Outlook

  • Vista running slow after update 11/05/2011 dealing with Outlook 2007

    Vista Home Prem running slow after update 11/05/2011 dealing with Outlook 2007. Now, it takes 30 to 45 seconds to open Outlook, or any program. I'm under IE 9.0.8112.16421.

    The installed updates were:

    Update of security for Microsoft Office System 2007 (KB2540162)

    Update for the filter of junk e-mail in Outlook 2007 (KB2536413)

    Update of security for Microsoft Office PowerPoint 2007 (KB2535818)

    Update for Windows Mail Junk e-mail filter [May 2011] (KB905866)

    Windows malicious software removal tool - may 2011 (KB890830)

    Update for Microsoft Office Outlook 2007 (KB2509470)

    Can anyone help?

    Thank you

    Tony

    Hi Tony,.

    You can try the following steps and check.

    Method 1:

    You can try to run the performance fix and check.

    Check out the link:

    http://support.Microsoft.com/mats/slow_windows_performance/

    Method 2:

    You can also read the following article and try the suggested steps.

    How to troubleshoot performance issues in Windows Vista

    http://support.Microsoft.com/kb/950685

    For more information, see the links:

    Optimize your computer for peak performance

    http://www.Microsoft.com/athome/Setup/optimize.aspx

    Hope this information is useful.

  • Win 7 - closing button displays updates to deal with but no updates ever treated on "stop".

    Latest windows 7

    Windows Update works fine in the sense that the traffic updates are treated and updated correctly.  But there are 3 or 4 weeks, I noticed the power off button displaying the exclamation symbol and when I got "high" on the button it displayed the following message - "installs the updates and then shuts your computer."

    I turned off, but no updates have been processed.  I turned on again and check the updates manually, but there is nothing exceptional.  I have a few days later a bunch of updates have been processed when I turned on (all properly updated), but I still got the message on the off button indicating updates to be processed when I turned off.  When I turned off no updates have been processed.  Other that an annoying message on the off button, there seems to be nothing wrong with my computer.

    To try to address the issue, I ran the Windows update program utility troubleshooting on the Microsoft site.  He said that this is a problem ("registration for the service is missing or corrupted") and said that it has been fixed.  However, the Power Off button continues to indicate that updates will be handled when I turned off, but stop down quickly without ever get processed implemented to date.

    This isn't a big problem for me, but everything just annoying.  Can anyone help

    Windows Update behaves properly and install updates when they become available.  The only problem is that ever time I'd go to power off the system tell me that updates would be installed when I turned off.  But there is never to deal with updates and the system would be turned off after a very slight delay.  So on advice from Microsoft, I changed the windows settings of update "manual" and checked from time to time for updates and the issue was "resolved."

  • Dealing with the size of the stage and the different orientations

    I am clearly dense, but I'm looking for examples of how others deal with the need to have apps that funciton in mode landscape or portrait.

    My first effort simply uses a scene from 600 x 600 with automatically guide the true value. It seems to work OK. The app draws, in the center of the screen of the Playbook (Simulator), regardless of the way the screen is oriented. Waste certain properties of the screen, but for my purposes, it doesn't really matter.

    To try to make it easier to deal with some questions I had try to implement new, I tried to make a step in 1024 x 600 with my stuff centered in space. Works very well in the landscape, but when in portrait mode, the app has been reduced to 1024 to the 600 dimension tree. I turned on Noscale for the scene, and now the app is drawn with the scene at the upper left corner then the app is cut on the right side of the screen. Is there a way to make the center of the scene?

    For my next one, I'll probably need to have two settings screen which are used based on direction - guidance on which is easier to deal with?

    I just wanted to mention that I removed the rotation and repositioning of the scene in the event onOrientationChange because I'm sure it was bad and can't remember why I had done this.

    Also, I recommend the mobile controls around on stage resize because when changing the orientation event is called, stage.stageWidth and stage.stageHeight properties have not yet been updated.

    The only uses for the orientation change event that come to mind anime the passage of an orientation towards another and the reorientation of handling maually when you autoOrients set to false.

  • Why it takes so long for the BlackBerry vendor to deal with accounts?

    Why it takes so long for the BlackBerry vendor to deal with accounts?

    I put in my request 3 days ago, and it has not yet been verified.

    Hello

    Could you please PM me your name of the seller? Do you get the email that asks you to send the document ID/commercial? If this isn't the case, please try to chcek your spam folder.

    Kind regards

    Satya

Maybe you are looking for

  • Firefox hangs frequently on Windows 8.1

    Firefox has been suspended at apparently random times since I got my laptop Windows 8.1, who owns an i7, 8 GB of RAM and Intel HD 4600 Graphics. Hanging itself lasts anywhere from 10 seconds to a few minutes, and it usually freezes all other programs

  • my text graphics are sometimes pixelated but are ok if I start it in SafeMode firefoxes

    I tried to disable addons, reinstall firefox with and without my original settings, but it still does it in safe mode it does not do so, it is quite noticeable in the face book but it also does other things of text, including the pluggins how to remo

  • Tecra A8 - ALERT: System Protection failure

    He y. I have Tecra A8 EZ 8313. yesterday, when I turn it on I have white screen and message like:ALERT: System Protection failurePassword: nothing works. I can not even get into the BIOS.I don't know what this is... nothing found in internet. Maybe s

  • Disk D: partition

    The partition of my D: drive has only 2 GB of free space (12 GB total).  How clean this up?  The partition of my drive C: has 268 free GB of GB 454.  My machine is a HP Pavilion KZ755AA-ABU s3552.uk with a basic core of 4.0.

  • Make the computer unusable for msconfig. Beginner trying to trouble shoot start.

    computer would start the start to the top and woul would some programs stop responding? then I tried troubleshooting of systems no, I can't evenconnect to internet. When I proceed with help & support I get this. Windows cannot respond because server