14. august 2016 - 12:24Der er
1 kommentar og 1 løsning
Select fra 3 tabler med union all??
hej jeg har denne query i en function, men ønsker og tilføje en eller flere tabler.
"SELECT news_title as title, news_text as text, news_created as date FROM news UNION ALL SELECT title as title, description as text, created as date FROM links WHERE active = '1' ORDER BY date DESC LIMIT $number"
hvordan tilføjer jeg denne table select article_title as title, article_desc as text, article_created as date FROM articles WHERE article_status = '1'
har prøvet og google lidt men finder ikke noget på union all med mere end 2 tabler..
UNION ALL kan bruges med vilkaarligt mange queries.
SELECT ... UNION ALL SELECT ... UNION ALL SELECT ... UNION ALL SELECT ... UNION ALL SELECT ... UNION ALL SELECT ... UNION ALL SELECT ... UNION ALL SELECT ... UNION ALL SELECT ... UNION ALL SELECT ... UNION ALL SELECT ... UNION ALL SELECT ...
jeg må ha skrevet forkert da jeg skrev det første gang.. Tak for hjælpen
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.