帮忙解析一下这个SQL语句~~~~特别是where后面的

fangenyuan 2005-03-30 02:41:33
select distinct a.proc_id,b.prop_val as '事由',c.prop_val as '车辆型号',d.prop_val as '出车时间',e.prop_val as '出车时间时',
f.prop_val as '出车时间分',g.prop_val as '回程时间',h.prop_val as '回程时间时',i.prop_val as '回程时间分',
j.role_reci as '出车司机'

from data_prop_inst a,data_prop_inst b,data_prop_inst c,data_prop_inst d,data_prop_inst e,
data_prop_inst f,data_prop_inst G,data_prop_inst h,data_prop_inst i,data_role_inst j

where

a.proc_id=b.Proc_id and b.prop_id=4 and
a.proc_id=c.Proc_id and c.prop_id=10 and
a.proc_id=d.Proc_id and d.prop_id=11 and
a.proc_id=e.Proc_id and e.prop_id=26 and
a.proc_id=f.Proc_id and f.prop_id=34 and
a.proc_id=g.Proc_id and g.prop_id=28 and
a.proc_id=h.Proc_id and h.prop_id=29 and
a.proc_id=i.Proc_id and i.prop_id=33 and
a.proc_id=j.proc_id and j.role_name='司机' and

a.proc_id in(select proc_id from proc_inst_all where piis_term=0 and data_refc=165 )

order by a.proc_id

该函数列表显示所有的派车单中的用户出车时间,其中司机字段需要获取角色数据
...全文
110 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
fangenyuan 2005-03-30
  • 打赏
  • 举报
回复
什么子查询啊~~就是表的自连接~~~看懂了
liuyangxuan 2005-03-30
  • 打赏
  • 举报
回复
Youself is condition connect.
liuyangxuan 2005-03-30
  • 打赏
  • 举报
回复
Use From Table inner join Table_second on condition where condition_second
enjsky 2005-03-30
  • 打赏
  • 举报
回复
不就是个多表之间的主键与外键的关联
加上了 一个

子查询吗
fangenyuan 2005-03-30
  • 打赏
  • 举报
回复
我也不知道什么意思~
反正最后得结果是完成了:显示所有的派车单中的用户出车时间,其中司机字段需要获取角色数据
underone 2005-03-30
  • 打赏
  • 举报
回复
那字段代表什么内容呢
fangenyuan 2005-03-30
  • 打赏
  • 举报
回复
晕~~~就是看不明白才问的~ -_-
而且我这里也没有数据库
就只是这个SQL语句
underone 2005-03-30
  • 打赏
  • 举报
回复
多表关联,你用试图看一下,就明白了
fangenyuan 2005-03-30
  • 打赏
  • 举报
回复
好像是表的自连接?~~~~@@ 看不懂

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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