select Field1 , Field2 , Field3 , 'Table1' as TableName From Table1
where ......
union
select Field1 , Field2 , Field3 , 'Table2' as TableName From Table2
where ......
union
select Field1 , Field2 , Field3 , 'Table3' as TableName From Table3
where ......
union
select Field1 , Field2 , Field3 , 'Table4' as TableName From Table4
where ......
where ......
union
select Field1 , Field2 , Field3 , 'Table2' as TableName From Table2
where ......
union
select Field1 , Field2 , Field3 , 'Table3' as TableName From Table3
where ......
union
select Field1 , Field2 , Field3 , 'Table4' as TableName From Table4
where ......
解决方案 »
- 关于在函数里面调用控件问题!
- 请教线程使用TWebBrowser控件问题
- 下面的这个COM对象是怎么建立的?
- 关于DrawGrid.Canvas.TextRect的输出文字换行问题,请指教.
- 请问各大师如何在DBGrid或DBGridEh表格中的不同的数据显示不同的颜色?
- 一个ado.query的问题
- 关于teechart里的一个series自动转换坐标轴的问题
- TWebbrowser的两个问题!!谢谢请帮忙!!
- 中国输了!!!!呜……
- function Execute(const SQL: String; Params: TParams = nil; Cache: Boolean
- 文本文件可不可以一边读一边写?
- 如何使鼠标在动态创建的三个按钮上浮动时,改变字体的颜色或改变图片?解决后马上给分!!!!
Select HouseNo,UserName,
'南京' as WhatTable
from 南京
where kind like '%电气化%'
union
Select HouseNo,UserName,
'中山' as WhatTable
from 中山
where kind like '%电气化%'
如果南京表和中山表中都没有(或有)符合条件的记录,或
第一个表不符合条件而第二个表符合,上述sql语句就显
示Type mismatch, 如果只有一个表(且是第一个表)符
合条件,sql执行正常,为什么?