Skip to content
Advertisement

Data from the table based on the received

Table Users: id, login, name, age

Table views: id, date, user_id, post_id

Table other: id, timeD (date), post_id

What is already there:

Result: date and user_id

I need to add in request to display data about the user (login, name, age), the user id is optional and the timeD column

Example: date timeD login name age

Note: the other table may be empty and then i need to output timeD as null, for example

Advertisement

Answer

Try to use left join:

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement