Re: collecting employees who completed 5 and 10 years in the current month - Mailing list pgsql-general

From Arup Rakshit
Subject Re: collecting employees who completed 5 and 10 years in the current month
Date
Msg-id 4877750.gPAFf06JjZ@linux-wzza.site
Whole thread Raw
In response to Re: collecting employees who completed 5 and 10 years in the current month  (Rebecca Clarke <r.clarke83@gmail.com>)
List pgsql-general
On Monday, June 30, 2014 04:52:32 PM you wrote:
> Hi Arup,
>
> Two ways come to mind for me. They're pretty much the same as Szymon's,
> just minus the sample table creation. I would suggest creating a view
> instead, so you can just select from it whenever you please.
>
>
>  create view vw_employee as
>    select * from employees
>    where ((age(joining_date::date) like '5 years%') or
> (age(joining_date::date) like '10 years%') )
>

But I am using Ruby on Rails framework to develop web application. Here I use
basically query. If no way, then I go for view. It seems I can use this as a
select query. But view of course a good idea.In our web app, we will show this
data as a report. A user can run it whenever he/she feel. All query seems like
current day query. But I really need current month. Again it sometimes feel
like ok, sometimes not.  :-)

--
================
Regards,
Arup Rakshit
================
Debugging is twice as hard as writing the code in the first place. Therefore,
if you write the code as cleverly as possible, you are, by definition, not
smart enough to debug it.

--Brian Kernighan


pgsql-general by date:

Previous
From: Rebecca Clarke
Date:
Subject: Re: collecting employees who completed 5 and 10 years in the current month
Next
From: Szymon Guz
Date:
Subject: Re: collecting employees who completed 5 and 10 years in the current month