一个小白的问题
问题如下:四张表,每张表里都有一个title列,现在我想同时把四张表里的title列查询出绑定到一个控件上,求具体查询代码。谢谢。
我的做法:SELECT [comnews].[title],[peonews].[title],[pronews].[title],[culnews.title]FROM [comnews],[peonews],[pronews],[culnews]不过有错误。
------解决方案--------------------
查询出两个表中所有数据包含重复
SELECT [comnews].[title] FROM [comnews] union all
SELECT [peonews].[title] FROM [peonews] union all
SELECT [pronews].[title] FROM [pronews] union all
SELECT [culnews.title] FROM [culnews]
去掉重复的
SELECT [comnews].[title] FROM [comnews] union
SELECT [peonews].[title] FROM [peonews] union
SELECT [pronews].[title] FROM [pronews] union
SELECT [culnews.title] FROM [culnews]