MySQL query with "List Options"

2 posts by 2 authors in: Forums > CMS Builder
Last Post: October 23, 2008   (RSS)

Re: [aev] MySQL query with "List Options"

By Dave - October 23, 2008

Hi aev,

This is pretty advanced MySQL - but I can try and point you in the right direction.

MySQL has a command called UNION that you can use to join multiple SELECT queries. Basically you enter your query, then enter "UNION" and another query. You can read the docs for it here: http://dev.mysql.com/doc/refman/5.0/en/union.html

And here's some sample code:
SELECT num, fullname FROM cms_accounts
UNION SELECT num, title FROM cms_jobs
UNION SELECT num, title FROM cms_news

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com