I have a MySQL table (A) which has, amongst others, three columns named “day”, “month” and “year” in each of which is stored a number which, when read together, will represent a date. I have to join this table with another table (B) in which the date column is in UNIX format. Is there an easy way which would allow me to compare the two dates from the two tables in an easy way?
Share
You can do:
But the unix timestamp column in
tableBis more precise to the second, whereas the columns in yourtableAcan only be precise to the day. As a result, it may not always join when you want it to.If you want it to join where the two times are within the same day, you can also make the unix time column a
DATEtype so that both are only precise to the day: