Last post Jul 28, 2014 12:43 AM by Mikesdotnetting
Jul 27, 2014 04:15 PM|BOG1|LINK
i had already
posted this question on the VB Forum, but a Moderator told me to post it here.
I need to build an self organization system with appointments, Tasks, links, etc. Each of this Objects have own tables. One table for tasks, one for links, etc. Each of the items belongs to an user with an userid.
What i want to achieve is, to query all items from these different tables, merge them to a virtually "Table" and show them up in one "wall" sorted by creation date.
Is is an image about what i wanted to to. Its something similar like facebooks wall, but the problem is, that the data could be different objects and these objects should be displayed in one wall including sorting.
Jul 28, 2014 12:43 AM|Mikesdotnetting|LINK
You can use UNION to join the results of several queries and aliases to ensure that each query returns data in the same shape:
SELECT Title, BeginAt, EndAt, UserId, CreatedAt, NULL AS Desc, NULL AS Url From tblTask
SELECT Title, NULL AS BeginAt, NULL AS EndAt, UserId, NULL As CreatedAt, Desc, URL From tblLink
SELECT Title, NULL AS BeginAt, NULL AS EndAt, UserId, Null AS CreatedAt, Desc, NULL AS Url From tblNotes