日期:2014-05-18 浏览次数:20564 次
--读取表1内有数据 ID=1,UserAdminID=999,并显示表2对应的 AccountName select a.*,b.AccountName, from UserSmsText a left join Account b on a.UserAdminID=b.ID left join PushData c on a.ID=c.UserSmsTextID where a.ID=1 and UserAdminID=999
------解决方案--------------------
--统计出 PushData表里面所有UserSmsTextID等于1并State='R'的行数。 select count(*) from UserSmsText a left join Account b on a.UserAdminID=b.ID left join PushData c on a.ID=c.UserSmsTextID where c.State='R' and c.UserSmsTextID=1
------解决方案--------------------
select count(1) from UserSmsText a left join Account b on a.UserAdminID=b.ID left join PushData c on a.ID=c.UserSmsTextID where c.State='R' and c.UserSmsTextID=1