select * from db1,db2 where db1.col='1' or db2.col='1'错在哪儿?

cmz2000 2002-12-06 04:14:30
两张foxpro的表,结构一样,我把它们凡是col='1'的记录全搜出来,这样写结果不对,该怎么写才行啊 ?
...全文
55 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
cmz2000 2002-12-06
  • 打赏
  • 举报
回复
怎么我从来没加分成功过?
cmz2000 2002-12-06
  • 打赏
  • 举报
回复
zf的调试通过,
其他的不行
yisong 2002-12-06
  • 打赏
  • 举报
回复
where db1.col=1 and db1.col=db2.col
就可以了!
tjing 2002-12-06
  • 打赏
  • 举报
回复
或是
select * from db1,db2 where db1.col=db2.col and db1.col=1 and db1.col=1
zfmich 2002-12-06
  • 打赏
  • 举报
回复
当然不对。

select * from db1 where col = '1'
union all
select * from db2 where col = '1'

2,507

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 数据库相关
社区管理员
  • 数据库相关社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧