MySQL Forums
Forum List  »  Docs

UNION does not seem to work
Posted by: Frans Streur
Date: February 05, 2017 11:16AM

The following 2 SELECTS with a UNION does not seem to work. table 1 (Interacties) has 20 entries and table 2 (uren) has none. The field types are consistent and when I do the first select I get the 20 entries of table 1. When I add the UNION, I only get 10. I don't get any errors.

SELECT
`in`.`Datum` AS `Datum`,
`in`.`Interactietype` AS `Type`,
`in`.`Uren` AS `Uren`,
'J' AS `Direct`
FROM
`tbl_interacties` `in`
UNION SELECT
`ur`.`Datum` AS `Datum`,
`ut`.`Type` AS `Type`,
`ur`.`Uren` AS `Uren`,
`ut`.`Direct` AS `Direct`
FROM
(`tbl_activiteiten` `ur`
JOIN `tbl_acttypen` `ut`)
WHERE
(`ur`.`Seq_Acttype` = `ut`.`Seq`)

Thanks for the help.
Cheers,
Frans Streur
MySQL 5.7. on Windows7/CentOS7.3

Options: ReplyQuote


Subject
Views
Written By
Posted
UNION does not seem to work
283
February 05, 2017 11:16AM
154
February 05, 2017 11:19AM
145
February 05, 2017 02:14PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.