我不知道我的问题是否存在解决方案。
我正在尝试重新组合来自两个类似查询的结果,而不使用除mySQL以外的任何其他内容。
以下是我的要求:
SELECT id, type as objet, decret as type, resume as synthese FROM projets
SELECT id, type as objet, decret as type, resume as synthese FROM articles
显然,如果我尝试
,我会收到一个模棱两可的错误SELECT id, type as objet, decret as type, resume as synthese FROM articles, projets
我想合并这些结果,以便将其导出到一个CSV文件中,而不使用Excel操作等。
由于
答案 0 :(得分:2)
尝试联盟
SELECT id, type as objet, decret as type, resume as synthese FROM projets
UNION
SELECT id, type as objet, decret as type, resume as synthese FROM articles
http://dev.mysql.com/doc/refman/5.0/en/union.html
假设两个表中的列相同。