I have a strange โproblemโ with one of my generated queries. Given the following query:
SELECT ID, DistanceFromUtrecht, ( SELECT (MAX(DateUntil) - (ReleaseDays * 60 * 60 * 24)) FROM PricePeriod WHERE PricePeriod.FK_Accommodation = Accommodation.ID ) AS LatestBookableTimestamp FROM Accommodation WHERE LatestBookableTimestamp < UNIX_TIMESTAMP()
phpMyAdmin continues to throw an error saying that it does not have a column named "LatestBookableTimestamp", even if I have a column received by a subquery, this alias. I also tried to select each column using tableprefix. This does not work fighter. Finally, I selected all the columns using the table alias, and I gave the table an alias. All without luck.
Can someone tell me what I'm doing wrong? I even looked for some resources to understand if I was not mistaken, but in many cases authors on the Internet use the same syntax as I do.
source share