Re: collecting employees who completed 5 and 10 years in the current month

Поиск
Список
Период
Сортировка
От Arup Rakshit
Тема Re: collecting employees who completed 5 and 10 years in the current month
Дата
Msg-id 4877750.gPAFf06JjZ@linux-wzza.site
обсуждение исходный текст
Ответ на Re: collecting employees who completed 5 and 10 years in the current month  (Rebecca Clarke <r.clarke83@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Rebecca Clarke
Дата:
Сообщение: Re: collecting employees who completed 5 and 10 years in the current month
Следующее
От: Szymon Guz
Дата:
Сообщение: Re: collecting employees who completed 5 and 10 years in the current month