I have some records in database. Now I want to get the record from date wise. Please see the below format of my table.
User_id name date Present
001 Jone 01-08-2012 yes
002 arun 01-08-2012 yes
001 Jone 02-08-2012 yes
002 arun 02-08-2012 yes
001 Jone 03-08-2012 yes
001 Jone 04-08-2012 yes
002 arun 05-08-2012 yes
001 Jone 05-08-2012 yes
001 Jone 06-08-2012 yes
001 arun 06-08-2012 yes
I want get “arun” report from 01-08-2012 to 07-08-2012 like this
User_id name date Present
002 arun 01-08-2012 yes
002 arun 02-08-2012 yes
002 arun 03-08-2012
002 arun 04-08-2012
002 arun 06-08-2012 yes
002 arun 07-08-2012
In order to display the missing date, you would need a temp table.
temp table:
sql as below:
SQL DEMO HERE.