有单位信息表a,有单位编码a1和单位名称两个字段a2;有出入库表b, 有出库单位编码b1,入库单位编码b2,出入库数b3三个字段,现在要查找出入库情况,但是只能显示单位名称,不能显示单位编号。头痛?
解决方案 »
- 关于inherited;
- 解析xml出现 Invalid at the top level of the document 错误如何解决?
- 救命!帮忙翻译一篇文章
- 自写的设计期包,出了一个非常困扰的问题,请各位帮心!
- 请问那位大虾知道那里有instalshield express custom edition for delphi下载
- delphi7安装和运行rave的问题
- 求助
- 现在多个讨论区正同时讨论 用BORLAND工具开发具有创意的web应用程序 的话题,大家快快快去看看
- (100分)如何建立动态DSN连接dBase 5.0数据库?
- time查询
- 还是用程序post的问题。
- Delphi IDE的使用方法
(select a2 from a table2 where table2.a1=b.b2) as b2,b3 from b 搞定!
from a, b, a c
where b.b1 := a.a1
and b.b2 := c.a1
selet a.a2, b.b1,b.b3
from a,b
where a.a1=b.b2
我觉得你和出库表应该 改一下,怎么有出库和入库两个编码的,实在要的话这样
select a.a2,b.* from a,b where a.a1=b.b1 union
select a.a2,b.* from a,b where a.a1=b.b2
from a,b
where a.a1=b.b1 or a.a1=b.b2
出库
select a.a2,b.b3
from a,b
where a.a1=b.b1
入库
select a.a2,b.b3
from a,b
where a.a1=b.b2
呵呵,应该是没有错误的!!!:)!
有问题发消息给我!
在用DBGRID显示的时候,使用LOOKUP字段,在关联一个查询SELECT * FROM A
关联关系A.A1=B.B1,显示A.A2。这样就可以了