SELECT * FROM foobar WHERE added_on < UNIX_TIMESTAMP() - 15778463
This is not exactly 6 months, since it is slightly different every year, but it should be close enough for each goal ( converted to Google seconds )
You can also convert the UNIX timestamp to a βrealβ timestamp and use the MySQL date and time functions on it, which will probably be more accurate and look prettier than the integer 15778463 hardcoded in the query (you can use INTERVAL 6 months ), but it will be much slower than working with regular integers.
source share