- 论坛徽章:
- 0
|
现有一张表,
username url
'bill' 'http://cn2spe3'
'bill' 'http://cn2spe3/home'
'bill' 'http://www.163.com'
'bill' 'http://mail.163.com'
'bill' 'http://www.tom.com'
'bill' 'http://mail.tom.com'
'hung' 'http://cn2spe3'
'hung' 'http://cn2spe3/home'
'hung' 'http://www.163.com'
'hung' 'http://mail.163.com'
'hung' 'http://www.sohu.com'
'hung' 'http://mail.sohu.com'
现在我要查出,username='hung'用户, 并且此用户的url不能是其它用户的url
也就是上面表中 'http://www.sohu.com' 与 'http://mail.sohu.com'
这个问题搞了我好久,希望能用一次查询得出,我试过inner join与left join但总是得不到正确的结果。
望哪位大虾帮下忙。 |
|