I want to write something like that, but alas, it does not work!
SELECT `year` FROM `success` JOIN (SELECT YEAR(now()) as `year`) `a`; It is clear that I join not quite the table, but how then to be?
I want to write something like that, but alas, it does not work!
SELECT `year` FROM `success` JOIN (SELECT YEAR(now()) as `year`) `a`; It is clear that I join not quite the table, but how then to be?
If I understand the task correctly, then we have a table of success
id year -------------------- 1 1889 2 2007 3 3015 We want to get the following result
year current_year -------------------------- 1889 2016 2007 2016 3015 2016 Then we will approach the request
SELECT `year`, YEAR(getdate()) as `current_year` FROM `success`; year FROM success , (SELECT YEAR (now ()) as year ) a ; - msiSource: https://ru.stackoverflow.com/questions/521869/
All Articles