下面这条sql语句怎样用内连接或者外连接实现,我是菜鸟,求指导!谢谢啦~很急
发布网友
发布时间:2022-04-27 07:58
我来回答
共3个回答
热心网友
时间:2023-10-02 14:14
string sql = "select Users.* ,Card.IsReportLost from Users,Card,Departments where Users.CardID = Card.CardID and Users.DeptID = Departments.ID";
select Users.*,Card.IsReportLost from Users join Card on Users.CardID = Card.CardID join Departments on Users.DeptID = Departments.ID
热心网友
时间:2023-10-02 14:15
select Users.* ,Card.IsReportLost from Users
left join Card on (Users.CardID = Card.CardID)
left join Departments on (Users.DeptID = Departments.ID)
热心网友
时间:2023-10-02 14:15
string sql = "select Users.*,Card.IsReportLost from Users
left join Card on Users.CardID = Card.CardID
left join Departments on Users.DeptID = Departments.ID";