| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 836 人关注过本帖
标题:请大家看看我的语句有什么问题[未解决]?
只看楼主 加入收藏
bygg
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:乖乖的心中
等 级:版主
威 望:241
帖 子:13555
专家分:3076
注 册:2006-10-23
收藏
得分:0 
你的语句可以改成
select a.name,id_card,b.sname,sfzh,a.bknbcode_id,b.leibie into shuju
from no07 a ,zuihoujieguo b
where a.name=b.sname
and len(b.sfzh)=15
and len(a.id_card)=15
and a.id_card=b.sfzh
and a.bknbcode_id=b.leibie
union
select a.name,id_card,b.sname,sfzh,a.bknbcode_id,b.leibie
from forums_ksbm a ,zuihoujieguo b
where a.name=b.sname
and
(
(
len(b.sfzh)=18
and len(a.id_card)=18
and a.id_card=b.sfzh
and a.bknbcode_id=b.leibie
)
or
(
(left(b.sfzh,6)=left(a.id_card,6)
and a.bknbcode_id=b.leibie)
and
(
(len(b.sfzh)=15 and len(a.id_card)=18 and substring(a.id_card,9,6)=substring(b.sfzh,7,6))
or
(len(a.id_card)=15 and len(b.sfzh)=18 and substring(b.sfzh,9,6)=substring(a.id_card,7,6))
)
)
)

不过为什么会出现相同的.你得看一下你的表中的数据是怎样的了.

飘过~~
2007-05-17 14:11
快速回复:请大家看看我的语句有什么问题[未解决]?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015874 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved