I have a table called Hotel and it has 3 columns hotid, hotname and year. I have get the date difference using the year. The SQL for that is as follows (and it works)
SELECT DATEDIFF('2010-08-04',NOW()) / -365 as Date_Value_Table ;
Now, i need to write an SQL that will list all the columns (records) from the Hotel table with another column called Date_Value_Table that takes the year column from the Hotel table and do a DATEDIFF as shown in above.
So basically i need a SQL that list all the records from the Hotel table and another column that does a DATEDIFF using the Year column from the Hotel table and to list all the records.
And i am using MySQL as my DB.
I am not sure if you mean this, but here it is: