MySQL Forums
Forum List  »  Newbie

correct way to sub select ?
Posted by: Jason Carroll
Date: April 09, 2016 12:45PM

I wish to get the results of one query and then append to the end the results of another query of the same table.

This only joins the results to the left of the results and not adding it to the bottom the first set.

How do I correctly get the first results and second results to be in the same results set. ?

SELECT `errors`.*, `oks`.*
FROM `affiliate` AS `oks`
LEFT OUTER JOIN `affiliate` AS `errors`
ON
`errors`.`isWebSiteLive` != 'HTTP/1.0 200 OK' AND `errors`.`isWebSiteLive` != 'HTTP/1.1 200 OK' AND `errors`.`isWebSiteLive` != 'HTTP/1.0 301 Moved Permanently' AND `errors`.`isWebSiteLive` != 'HTTP/1.1 301 Moved Permanently'

WHERE
`oks`.`isWebSiteLive` = 'HTTP/1.0 200 OK' OR `oks`.`isWebSiteLive` = 'HTTP/1.1 200 OK' OR `oks`.`isWebSiteLive` = 'HTTP/1.0 301 Moved Permanently' OR `oks`.`isWebSiteLive` = 'HTTP/1.1 301 Moved Permanently'

ORDER BY `errors`.`isWebSiteLive`, `errors`.`Title`, `oks`.`isWebSiteLive`, `oks`.`Title`
LIMIT 0, 100

Options: ReplyQuote


Subject
Written By
Posted
correct way to sub select ?
April 09, 2016 12:45PM


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.