Home » SQL & PL/SQL » SQL & PL/SQL » "view" data of last week,month,year
"view" data of last week,month,year [message #376867] Thu, 18 December 2008 23:59 Go to next message
sispk6
Messages: 164
Registered: November 2006
Location: pakistan
Senior Member
hi i have a table
  table user_login
   {
    empno , 
    login_date ,
    rec_id
   };
its has data


  empno         logindate       rec_id
  11798         12/17/2008      1  
  11798         12/16/2008      2  
  11798         12/14/2008      3  

  11798         11/27/2008      5  
  11798         11/28/2008      4
  11798         11/22/2008      10
  11798         11/26/2008      6  

  11798         6/27/2008       7  
  11798         5/28/2008       8
  11798         8/26/2008       9  


i want to create a view that shows me login details as on
per week, per month , per year
view say V_LOGIN_DURATION (has field)

( pno , lastsevendays , lst30days , last365days).

kindly help im stuck at it.
Thanks


Re: "view" data of last week,month,year [message #376870 is a reply to message #376867] Fri, 19 December 2008 00:27 Go to previous messageGo to next message
trivendra
Messages: 208
Registered: October 2007
Location: Noida, India
Senior Member
Post what you have tried , so we can help you.
Re: "view" data of last week,month,year [message #376873 is a reply to message #376867] Fri, 19 December 2008 00:37 Go to previous message
Michel Cadot
Messages: 64139
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Also post a test case: create table and insert statements along with the result you want with these data as well as your Oracle version (4 decimals).

Regards
Michel

Previous Topic: How to store data from mapping table into variables(arrays) and using variables to get mapping info
Next Topic: help in String manipulation
Goto Forum:
  


Current Time: Thu Dec 08 16:30:14 CST 2016

Total time taken to generate the page: 0.08252 seconds