oncik oncik - 1 year ago 64
SQL Question

Count how many month had passed

It goes like

SELECT fname, date_emped
FROM table_1

Then it gave me the table

fname | date_emped
John | 03-JAN-07
Smith | 02-JAN-08

I wanted to count how many months they had employed or worked here up until today.

Answer Source

I am not champ in orcale but this might do

	SELECT fname, date_emped, MONTHS_BETWEEN 
    date_emped) "Months"
FROM   table_1