首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

求比较两个表大小的话语

2012-09-19 
求比较两个表大小的语句access两个表a,b都有共同的字段id,num、a表:idnum101510210b表:idnum101110212如何

求比较两个表大小的语句
access两个表a,b
都有共同的字段id,num、
a表:id num
  101 5
  102 10

b表:id num
  101 1
  102 12

如何找出a表中与b表中相同id,但num小于b表中的数据。
也就是列出上面的101
用sql语句该怎么写?

[解决办法]
to horselily:
select a.* from ckls where dj_num='1104' a,sp_storage_pici b
where a.line_sp_id = b.line_sp_id and a.num<b.remain_num

提示操作符丢失,怎么处理? 

select a.* from ckls a,sp_storage_pici b where dj_num='1104' and a.line_sp_id = b.line_sp_id and a.num<b.remain_num

热点排行