select distinct fb_mamodel from tblb_machine where fb_macode in(select distinct fb_macode from tblb_matoba where fbatterycode='$fbatterycode') and fclasscode='1' and fb_mabrand='$fb_babrand'"
...全文
1073打赏收藏
帮我解析下这段SQL语句好吗?
select distinct fb_mamodel from tblb_machine where fb_macode in(select distinct fb_macode from tblb_matoba where fbatterycode='$fbatterycode') and fclasscode='1' and fb_mabrand='$fb_babrand'"
"select distinct * from tblad_machine where fmabrand='$mabrand' and fmacode in (select distinct fmacode from tblmatoad where fadcode in (select distinct fadcode from tblnewadapters where ftype='AC')) order by fmabrand"
select distinct fb_mamodel from tblb_machine where fb_macode in(select distinct fb_macode from tblb_matoba where fbatterycode='$fbatterycode') and fclasscode='1' and fb_mabrand='$fb_babrand'"
distinct : 使记录不重复
查询 fb_macode 等于子查询 (select distinct fb_macode from tblb_matoba where fbatterycode='$fbatterycode')
并且满足 fclasscode='1' and fb_mabrand='$fb_babrand'