need help on sql on the full month
HelloI have a table as below:
The table name:
Information
-----------------
staff_number
Date
clock_in
clock_out
Note
I want to create sql which will list down all date selection staffnumber
Select date, clock_in, staff_number, clock_out, information note where (date > = to_date('01/01/2010') and date < = to_date('01/02/2010')) and staff_number = "012345 '
Can someone help me on how to change the sql code out in the list, if there is no database on a certain date.
For example
012345 8.10 01/01/2010 17:30
012345 8.12 02/01/2010 16:30
012345 03/01/2010 - not in the database, but I want it appears in sql
012345 04/01/2010 08:30 18:40
012345 8.10 05/01/2010 16:30
012345 06/01/2010 08:30 16:30
....
012345 8.10 02/01/2010 16:30
Thanks in advance
You don't need LAST_DAY then:
select to_date('13/01/2010', 'dd/mm/rrrr')+ level-1 dt
from dual
connect by level <= to_date('23/02/2010', 'dd/mm/rrrr')-to_date('13/01/2010', 'dd/mm/rrrr')+1;
(And subtract from the most recent date)
Tags: Database
Similar Questions
-
Need help with SQL for the following logic.
I have a table with 3 columns and the following data:
DATE NAME S_NO
1 ABC1 JANUARY 1, 2001
1 ABC2 JANUARY 10, 2001
1 ABC3
1 ABC4
ABC1 2 1 DECEMBER 2010
ABC2 2
2 ABC3 DECEMBER 10, 2010
2 ABC4 DECEMBER 5, 2010
3 XYZ1 FEBRUARY 1, 2001
3 XYZ2 FEBRUARY 2, 2001
I need to retrieve the value of NAME for each S_NO corresponding to the maximum DATE. In the above example, it will be:
1 ABC2
2 ABC3
3 XYZ2/* Formatted on 9/10/2012 2:50:13 PM (QP5 v5.139.911.3011) */ WITH t AS (SELECT 1 S_NO, 'ABC1' NAME, '1-JAN-2001' dt FROM DUAL UNION ALL SELECT 1, 'ABC2', ' 10-JAN-2001' FROM DUAL UNION ALL SELECT 1, 'ABC3', NULL FROM DUAL UNION ALL SELECT 1, 'ABC4', NULL FROM DUAL UNION ALL SELECT 2, 'ABC1', '1-DEC-2010' FROM DUAL UNION ALL SELECT 2, 'ABC2', NULL FROM DUAL UNION ALL SELECT 2, 'ABC3', '10-DEC-2010' FROM DUAL UNION ALL SELECT 2, 'ABC4', '5-DEC-2010' FROM DUAL UNION ALL SELECT 3, 'XYZ1', '1-FEB-2001' FROM DUAL UNION ALL SELECT 3, 'XYZ2', '2-FEB-2001' FROM DUAL) SELECT * FROM (SELECT S_NO, name, RANK () OVER (PARTITION BY s_no ORDER BY TO_DATE (dt, 'dd-mon-yyyy') DESC) rk FROM t WHERE dt IS NOT NULL) WHERE 1 = RK
-
I eventually had to buy a new copy of microsoft and this one is now said that it is not authentic having been very well for more than 3 weeks. The only change that I made today is installing gigabytes 3TG unlock app to allow my 3 TB drive be seen. Here are the results of the MGAgiag tool:
Diagnostic report (1.9.0027.0):
-----------------------------------------
Validation of Windows data-->Validation code: 50
Code of Validation caching online: 0x0
Windows product key: *-* - RRWKG - 2TRRD-HXHP9
The Windows Product Key hash: Kw2 + wsNa9eyeAuaDxlYoOTYaahU =
Windows product ID: 00426-956-1227277-85101
Windows product ID type: 5
Windows license type: retail
The Windows OS version: 6.1.7601.2.00010100.1.0.001
ID: {56D76133-6AEF-4E72-91D9-860430433867} (1)
Admin: Yes
TestCab: 0x0
LegitcheckControl ActiveX: N/a, hr = 0 x 80070002
Signed by: n/a, hr = 0 x 80070002
Product name: Windows 7 Ultimate
Architecture: 0 x 00000009
Build lab: 7601.win7sp1_gdr.120830 - 0333
TTS error:
Validation of diagnosis:
Resolution state: n/aGiven Vista WgaER-->
ThreatID (s): n/a, hr = 0 x 80070002
Version: N/a, hr = 0 x 80070002Windows XP Notifications data-->
Cached result: n/a, hr = 0 x 80070002
File: No.
Version: N/a, hr = 0 x 80070002
WgaTray.exe signed by: n/a, hr = 0 x 80070002
WgaLogon.dll signed by: n/a, hr = 0 x 80070002OGA Notifications data-->
Cached result: n/a, hr = 0 x 80070002
Version: N/a, hr = 0 x 80070002
OGAExec.exe signed by: n/a, hr = 0 x 80070002
OGAAddin.dll signed by: n/a, hr = 0 x 80070002OGA data-->
Office status: 109 n/a
OGA Version: N/a, 0 x 80070002
Signed by: n/a, hr = 0 x 80070002
Office Diagnostics: 025D1FF3-364-80041010_025D1FF3-229-80041010_025D1FF3-230-1_025D1FF3-517-80040154_025D1FF3-237-80040154_025D1FF3-238-2_025D1FF3-244-80070002_025D1FF3-258-3Data browser-->
Proxy settings: N/A
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Win32)
Default browser: C:\Program Files (x 86) \Internet Explorer\iexplore.exe
Download signed ActiveX controls: fast
Download unsigned ActiveX controls: disabled
Run ActiveX controls and plug-ins: allowed
Initialize and script ActiveX controls not marked as safe: disabled
Allow the Internet Explorer Webbrowser control scripts: disabled
Active scripting: allowed
Recognized ActiveX controls safe for scripting: allowedAnalysis of file data-->
Other data-->
Office details:{56D76133-6AEF-4E72-91D9-860430433867} 1.9.0027.0 6.1.7601.2.00010100.1.0.001 x 64 *-*-*-*-HXHP9 00426-956-1227277-85101 5 S-1-5-21-1441504076-4266836338-3691997755 Gigabyte Technology Co., Ltd.. GA-990FXA-UD3 Award Software International, Inc.. F9 20121022000000.000000 + 000727D3A07018400F2 0409 0409 Central Standard Time(GMT-06:00) 0 3 109 Content Spsys.log: 0 x 80070002
License data-->
C:\Windows\system32\slmgr.vbs(1333, 5) Microsoft VBScript runtime error: permission deniedWindows Activation Technologies-->
HrOffline: 0x00000000
HrOnline: 0x00000000
Beyond: 0 x 0000000000000000
Event timestamp: 11:4:2012 22:43
ActiveX: Registered, Version: 7.1.7600.16395
The admin service: recorded, Version: 7.1.7600.16395
Output beyond bitmask:--> HWID data
Current Hash HWID: OAAAAAIABgABAAEAAAACAAAAAQABAAEA jFev9aD1DaILBAz3N/cFZRlVPK0cxwhYj1Q1I4ibnU plusActivation 1.0 data OEM-->
N/AActivation 2.0 data OEM-->
BIOS valid for OA 2.0: Yes, but no SLIC table
Windows marker version: N/A
OEMID and OEMTableID consistent: n/a
BIOS information:
ACPI Table name OEMID value OEMTableID value
APIC GBT GBTUACPI
FACP GBT GBTUACPI
HPET GBT GBTUACPI
MCFG GBT GBTUACPI
MSDM GBT GBTUACPI
EUDS GBT
CARPET GBT
TAMG GBT GBT B0
CARPET GBT
SSDT AMD POWERNOWI suspect that the problem lies in your drivers TSRI - they seem to be very fragile, so the best thing would be to uninstall them, apply the patch of GB and then install the last series (when / if you feel it!)
For your motherboard, the latter would be to http://downloadcenter.intel.com/Detail_Desc.aspx?agr=Y&ProdId=3449&DwnldID=22194
-
I just reinstalled windows xp sevice pack 3 in my laptop. l need help to set up the wireless modem. My laptop is IBM ThinkPad and the modem is a construction in one. would appriciate ay help
Hi bardhiboris,
You can follow the steps from the link below: set up a wireless network:http://www.microsoft.com/windowsxp/using/networking/setup/wireless.mspx
Other links, please refer to: 10 tips to help improve your wireless network:http://www.microsoft.com/athome/setup/wirelesstips.aspx
To set up automatic wireless network configuration:http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/wlan_client_configure.mspx?mfr=true
With regard to:
Samhrutha G S - Microsoft technical support.
Visit our Microsoft answers feedback Forum and let us know what you think.
-
I really need HELP! I received the nugel.exe virus on my laptop. I have Windows XP and I was reading how to remove it. They told me to go to click on the Start button in it, then click on run. type msconfig and on the Startup tab, uncheck everything that ends with TSSD. Well, none of which ended in TSSD was there, so I was told everything that had an UNKNOWN manufacturer in buttons SERVICES and STARTUP uncheck. I restarted my computer and the NELSON was always there. Then suddenly my computer shut down on its own and restarted with a screen that says now "Windows didn't start because the following file is missing or corrupt: \system32\hal.dll
.» Please reinstall a copy of the above file. "Does anyone know how to do this? I feel that I've dealt with the virus stupid for days and I'm going crazy! Can someone please help me solve what I did wrong? PLEASE, I BEG YOU! Hi ehaze64,
Looks like you have made incorrect changes in system configuration utility.
See the Microsoft articles below to solve the problem by installing the recovery console and use the Bootcfg.exe tool to rebuild the Boot.ini file.
How to install and use the Recovery Console in Windows XP
http://support.Microsoft.com/kb/307654
Error message: "Windows did not start because of a configuration of the disk of the computer problem.
http://support.Microsoft.com/kb/314477
"Invalid Boot.ini" or "Windows did not start" error messages when you start your computer
http://support.Microsoft.com/kb/330184
I hope this helps!
Halima S - Microsoft technical support.
Visit our Microsoft answers feedback Forum and let us know what you think.
-
Adobe muse work on a menu lighbox and need help I can not the box of active relaxation, even if I checked trigger on top anyone with a suggestion?
Thank you, it ends up being a superposition problem, thank you, but I can see where an invisible element could be a problem too. I use to select it all the trick to understand where I've been in Illustrator all time years ago I am so new Muse that I kept thinking can be as simple as I can go back to things I've done in other Adobe programs, but it is! and I'm an old school Print Designer who doesn't REALLY know the thing no coding thank once again
-
I can't find a certain number of support the customer to solve this problem.
You can contact the Support from Adobe using link below:
[Click on always need help button and select the Chat option]
-
Hello! I need help! I have the dvd for lightroom 5 and when I put it in my cumputer it dosent see DVD... What can I do?
You can try to download instead of using the drive...
Lightroom - all versions
Windows
http://www.Adobe.com/support/downloads/product.jsp?product=113&platform=Windows
Mac
http://www.Adobe.com/support/downloads/product.jsp?product=113&platform=Macintosh
-
Activation - need a phone number for the full activation of Windows 7 upgrade.
I finished an upgrade to Windows 7 Home Premium (64 bit) to Windows Vista Ultimate (32 bit). I had to do a CUSTOM installation, because I have also improved the C:\ drive for a RAID 1 configuration. It necessary to re-formattting the drives in the RAID unit eliminating the contents of the disc. Attempt to activate Windows 7 product fails because there is no field to enter the full Windows Vista Edition activation key. In addition, your instructions to locate a phone number for my operating system have no choice of site of "phone". All I need is an activation of the PHONE NUMBER.
How to activate Windows 7 manually (activate by phone)
1) click Start and in the search for box type: slui.exe 4
(2) press the ENTER"" key.
(3) select your "country" in the list.
(4) choose the option "activate phone".
(5) stay on the phone (do not select/press all options) and wait for a person to help you with the activation.
(6) explain your problem clearly to the support person.
http://support.Microsoft.com/kb/950929/en-usor
Direct activation number: (888) 725-1047
1-800-936-5700
-
Under Update taking 2 h complete 3000 sets.
UPDATE ARR_TRANSACTIONS ARR
SET = NUMBER99
(SELECT ARR_1.NUMBER99
OF ARR_TRANSACTIONS ARR_1, ARR_HEADER BH
WHERE ARR_1.ARR_ID = BH. ARR_ID
AND BH. FLAG = "Y".
AND ARR_1.LINE_ID = ARR. ORIG_INV_LINE_ID
AND ARR_1.NUMBER9 IS NOT NULL
AND ROWNUM = 1)
WHERE ARR BATCH_ID = 26219
AND ARR. NUMBER99 IS NULL
I added more some condition where to reduce cost and its working fine. But I need to rise more than performance on SQL.
Please help with SQL.
I do not see the number of 3000 lines in the plan - so I guess that the optimizer does not compute with the correct numbers. Could generate the plan with dbms_xplan.display_cursor? This could tell us something about filter predicates and access.
In the given situation, I would check:
- is the access to the index in step 1 (filtered by the relevant conditions: this could be BATCH_ID = 26219) return actually 248 entries (or something similar)?
- Access table in step 2 returning 204 lines (or something similar) after applying the filters given? If the number of lines is much bigger then a Nested Loops is perhaps not a good idea.
To make this much simpler check, you could create a plan with statistics of content (RowSource) given that the plan containing the real and the number of estimated rows.
If the estimated cardinalities are not plausible the next question would be if the statistics are strong and up to date.
-
Need help with SQL/PL/SQL for Dates
Hi Experts - need help with a SQL query.
I need to insert some date fields in a table called CALENDAR_PERIOD.
Current data in CALENDAR_PERIOD table with their data types:
STARTPERIOD (DATE) YEAR (NUMBER) PERIOD_LABEL (Varchar2 255)
02/11/2014 2014 2014/02/11 SUN
03/11/2014 2014 14/03/11 MON
04/11/2014 2014 11/04/14 MAR
I have to increment above values up to the year 2025. I don't know how to write SQL and increment of these values.
Ex: My next value should insert: 05/11/2015 2014 11/05/14 WED like that I need to insert data until 12 31, 2025.
Can you please help me with PL/SQL block?
Really appreciate your help!
DB version:
Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE Production 11.2.0.3.0
AMT for IBM/AIX RISC System/6000: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production
Thank you
SandyHello Sandy,
Maybe something like
INSERT INTO calendar_period (startperiod, year, period_label)
SELECT DATE '' 2014-11-04 + LEVEL
, TO_NUMBER (TO_CHAR (DATE '' 2014-11-04 + LEVEL, "YYYY"))
, TO_CHAR (DATE '' 2014-11-04 + LEVEL, "MM/DD/YY DY")
OF the double
CONNECT BY LEVEL<= date="" '2025-12-314="" -="" date="">=>
;
((mais je ne comprends pas pourquoi nous créons une telle table "année" et "period_label" peuvent être calculé à partir de startperiod))
Best regards
Bruno Vroman.
-
Run multiple chooses due to several input values (need help in SQL)
Hello
I would need to run multiple SQL select statements I get input of several results of the subquery. In my test case, I get three 3 results of the subquery
Select ALL_TABLES where LAST_ANALYZED is not null AND OWNER of TABLE_NAME = "IHS" AND TABLE_NAME LIKE '_TBL_PROCESS %' AND (SYSDATE-LAST_ANALYZED) < 1 order by (SYSDATE-LAST_ANALYZED
The complete query is:
SELECT SDE_ID, SERVER_ID, REGISTRATION_ID, TABLE_NAME, CONNECTOR, START_TIME, NODENAME OF THE
* (select ALL_TABLES where LAST_ANALYZED is not null AND OWNER of TABLE_NAME = 'IHS' AND TABLE_NAME LIKE '_TBL_PROCESS %' AND (SYSDATE-LAST_ANALYZED) < 1 order by (SYSDATE-LAST_ANALYZED)) *.
Can someone help me to get the appropriate SQL code?
Thank you
DejanRight. I should have put a comment explaining that. I used the name A_TBL_PROCESS because the WHERE clause has
'AND table_name like '% _TBL_PROCESS' ' then yes that should be a table name that will be selected. -
Need help after you insert the CMS system
Hi on my site ive inserted a system of Cushy CMS. It all work that is not the problem. The problem is that my page is a mess now... The only thing ive addes is a code cms so im hoping that the solution is not difficult to do.
There are three pages what is changed full.
The home page
http://www.vakantiewoningeninsuriname.nl/index.html
The text column to the right is less moved. How is it possible to place this back?
on http://www.Dorff.nl/ you can see how it was before I add the CMS.
The next page is:
http://www.vakantiewoningeninsuriname.nl/bezienswaardighedenparamaribo.html
You can see that there is much more space between the head and the text. And you see that the text is not only the anymmore on the right side.
This is how it should be:
http://www.Dorff.nl/bezienswaardighedenparamaribo.html
It goes the same for this page:
http://www.vakantiewoningeninsuriname.nl/Prijzen.html
And that's how what it takes:
http://www.Dorff.nl/Prijzen.html
Hope you can help, thank you for the research...
Kind regards Brian
braico wrote:
Dear Jacqueline,
Thank you for your reply,
I'll try to explain again what is wrong. On my website, you see this page:
http://www.vakantiewoningeninsuriname.nl/Prijzen.html
Problem is the image below on the right side of the page instead of the left like the other pictures.
On:
http://www.Dorff.nl/Prijzen.html
You can see what it should look like... Photos to the left and the text on the right. I don't know what happened when im adding the Cuschy CMS. Hope you can see what the problem is.
You have the two last property on the wrapped page entries in the
"one_half_last" when thatmust encapsulate the entry of details of each property individually. That is why the last image is more to the right.What I would do is remove the entries of two last property (images and text) on the page, copy the code from the entrance of the two property then paste it under twice, making your entries in four properties. Of course, you need to update images and details of the property as well.
OR if you're good with the code alters entered two details latest properties are isloated in their own "one_half_last".
-
Need help in SQL terms explain
Hello
I tried to get a plan to explain to the query below. (See A).
Table BILL_DETAIL have ZONECODE index, OMNR, postcode, WCNO but always it is
list "TABLE ACCESS FULL in BILL_DETAIL"
If I select only the first 4 columns, it will by index. (SEE - B)
According to my knowledge index will review only when the conditions of clause
but here I did not understand why this considering select output columns.
First time I try sql explain plan statement, please help me fix
This query.
CONSULT - HAS
---------
EXPLAIN PLAN FOR
SELECT OMNR, B.AREACODE, B.ZONECODE, ZONECODE, B.WCNO WCNO POSTAL CODE B.MRNO.
B.BILLNO BILLNO, B.BILLDT BILLDT, B.FROMDT FROMDT, TODT, B.TOBEPAID TOBEPAID B.TODT,
B.PREVUNPAID PREVUNPAID, B.DUEDT DUEDT
OF BILL_DETAIL B, CONSUMER_MASTER C
WHERE B.ZONECODE = C.ZONECODE
AND B.MRNO = C.MRNO
AND B.AREACODE = C.AREACODE
AND B.WCNO = C.WCNO
AND UPPER (B.ZONECODE) = UPPER('SZ-4')
AND UPPER (B.MRNO) = UPPER('347')
AND UPPER (B.AREACODE) = UPPER('18')
AND UPPER (B.WCNO) = UPPER('30910')
-----------------------------------------------------------------------
| ID | Operation | Name | Lines | Bytes | Cost (% CPU).
-----------------------------------------------------------------------
| 0 | SELECT STATEMENT | 1. 71. 9 (0) |
| 1. NESTED LOOPS | 1. 71. 9 (0) |
|* 2 | TABLE ACCESS FULL | BILL_DETAIL | 1. 52. 9 (0) |
|* 3 | INDEX UNIQUE SCAN | SYS_C008803 | 1. 19. 0 (0) |
-----------------------------------------------------------------------
Information of predicates (identified by the operation identity card):
---------------------------------------------------
2 filter (SUPERIOR ("B".) "ZONECODE") = "SZ - 4" AND SUPERIOR ('B'. "" " OMNR") ="347 '
AND SUPERIOR ("B". "AREA CODE") = '18' AND UPPER ('B'. " WCNO")"(30910') = "
3 - access("B".") ZONECODE "=" C ". "' ZONECODE ' AND 'B '. "" OMNR "=" C ". "" OMNR ".
"AND 'B'". "" POSTAL CODE '=' C '. "' POSTCODE ' AND 'B '. "" WCNO "=" C ". ("' WCNO")
SEE - B
---------
EXPLAIN PLAN FOR
SELECT OMNR, B.ZONECODE ZONECODE, B.WCNO WCNO, B.AREACODE ZIP CODE B.MRNO
OF BILL_DETAIL B, CONSUMER_MASTER C
WHERE B.ZONECODE = C.ZONECODE
AND B.MRNO = C.MRNO
AND B.AREACODE = C.AREACODE
AND B.WCNO = C.WCNO
AND UPPER (B.ZONECODE) = UPPER('SZ-4')
AND UPPER (B.MRNO) = UPPER('347')
AND UPPER (B.AREACODE) = UPPER('18')
AND UPPER (B.WCNO) = UPPER('30910')
--------------------------------------------------------------------------
| ID | Operation | Name | Lines | Bytes | Cost (% CPU).
--------------------------------------------------------------------------
| 0 | SELECT STATEMENT | 1. 34. 4 (0) |
| 1. NESTED LOOPS | 1. 34. 4 (0) |
|* 2 | FULL RESTRICTED INDEX SCAN FAST | SYS_C008798 | 1. 15. 4 (0) |
|* 3 | INDEX UNIQUE SCAN | SYS_C008803 | 1. 19. 0 (0) |
--------------------------------------------------------------------------
Information of predicates (identified by the operation identity card):
---------------------------------------------------
2 filter (SUPERIOR ("B".) "ZONECODE") = "SZ - 4" AND SUPERIOR ('B'. "" " OMNR") ="347 '
AND SUPERIOR ("B". "AREA CODE") = '18' AND UPPER ('B'. " WCNO")"(30910') = "
3 - access("B".") ZONECODE "=" C ". "' ZONECODE ' AND 'B '. "" OMNR "=" C ". "" OMNR ".
"AND 'B'". "" POSTAL CODE '=' C '. "' POSTCODE ' AND 'B '. "" WCNO "=" C ". ("' WCNO")
Note
-----
-"PLAN_TABLE' is old versionuser13295080 wrote:
Thanks for your responseAccording to my understanding index is used for during the extraction of the planned line (depending on the place where clause)
in less time. I don't understand the relationship between output and full table scan columns
selected in the query.You have used the above function in which your article, it can't use your index finger to access the lines just looking. You must analyze all ranks.
In your second query, you select only the lines that are in the index, so instead of scanning the entire table (full table scan), it can scan the entire index instead (the full index scan). But "full" in both cases.
Don't use higher functions, or use a function based index to accommodate this request, if you want a unique index (or not) analysis to arrive at bill_detail.
Kind regards
Rob. -
I need help. Electricity blimped last night at my father, leaving the computer does not off properly. We have tried to unplug the unit from the wall to reset, but again it still leaves us with the "power - on Password enter" can anyone help? Thanks in advance
Hello:
Please see the below troubleshooting guide, annex B, page 62.
Maybe you are looking for
-
Hello I recently went to a concert and have some of the videos I recorded audio and some do not (sounds like static on a TV). I was wondering if there was any way to turn the sound on my existing recorded videos? I tried to go through question differ
-
Satellite A100-033 - black screen with no data after the advanced boot option
I tried each F8 option in the advanced boot options to get my work laptop. There is just a black slowed after repairing Windows files and Loaded. Also F2 & F12 even when I try to use the recovery disk it remans black?Safe mode: nothing is displayed o
-
Adding ram to HP G72 - b10SV Notebook PC
I can add 2 x 4 GB of ram for my PC portable HP G72-b10SV, who has already installed a 2 + 1 GB ram?
-
Hello. I'm new to scripting Diadem and need to write a script to perform a task of processing of data on a large number of newspapers measure TDMS files (numbered sequentially). The script has to open each file individually (as they are very large),
-
unhandled win32 exception occurred in spoolsv.exe [172] windows xp sp3
How can I solve this problem guy? It makes me crazy caze whenever I start my laptop it have the same error Note, I do not develop tools, but he's keeping tell me handle using visual studio 2005