`

mysql联表查询

 
阅读更多

第一种方式:(子查询方式)

select *  from duration where account_idAccount= any(select account.idAccount from account where account.user_idUser= any(select user.idUser from user where user.userName= ?))

 

第二种方式:(join方式)

 

 select duration.*from duration inner join account,user where duration.account_idAccount=account.idAccount and account.user_idUser=user.idUser and userName=?

 


 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics