0
I want to make a table together information from 3 tables. This table will be ordered by date (day/month/year Hours:Minutes) and visually speaking would look like this
For better understanding I will post the structure of the banks
table: realation_notes
id user_id comments comment_date
table: historic_attendance
id user_id date contact_contact
table: clients_documents
id user_id file_name Attachment date
initially thought to use a UNION more or less like this
(SELECT id, user_id, comments, comment_date AS date FROM `realation_notes`
WHERE `user_id` = 582)
UNION
(SELECT * FROM `historic_attendance` WHERE `user_id` = 582)
UNION
(SELECT * FROM `clients_documents` WHERE `user_id` = 582)
ORDER BY date
but this SQL returns me the following error:
Os comandos SELECT usados têm diferente número de colunas
how could I get around this problem?