I have 5 tables with many records. Each table has "Date" columns, in which there may be only one date per user (the last date on which a user modified their profile is stored, for example) or many dates per user (the dates on which the user has posted one or more ads). How could I make a query to select all the dates of each table taking into account the user?
At the moment I have this
SELECT DISTINCT Acept_Date, Marc_Fec, Cont_Mod, Emp_Mod, Dir_Mod
FROM anunciosaceptados, anunciosmarcados, contacto, datos_empresa, direcciones
WHERE Acept_usu = 'gmarsi'
AND Marc_Usu = 'gmarsi'
AND Con_Usu = 'gmarsi'
AND Emp_Usu = 'gmarsi'
AND Dir_Usu = 'gmarsi'
and it is not working for me, because it shows me many repeated records as seen in the image. The tables that end in _Mod only save one date per user and show me many more