试一下! select count(stat.SERVLETPATh) from urlname url,visitstat stat where stat.userid='test_lujuan' and stat.SERVLETPATH = substr(url.url,1,length(stat.SERVLETPATH))(+) group by stat.SERVLETPATh;
这样行不?不知道你根据什么关联条件来确定,如果想查找不在表urlname 不存在,只要在外关联后判断主键值就可以了! select count(stat.SERVLETPATh) from urlname url,visitstat stat where stat.userid='test_lujuan' and stat.SERVLETPATH = url.url(+) and utl.url is null group by stat.SERVLETPATh;
a表与b表做关联查询,用模糊查询,要查出用模糊查询查不属于b表中的值,b表中不会出现空值!
table a abc bbc ccctable b abcdef bbcdef我想查出a表中的ccc
select count(stat.SERVLETPATh) from urlname url,visitstat stat
where stat.userid='test_lujuan' and
stat.SERVLETPATH = substr(url.url,1,length(stat.SERVLETPATH))(+)
group by stat.SERVLETPATh;
select count(stat.SERVLETPATh) from urlname url,visitstat stat
where stat.userid='test_lujuan' and
stat.SERVLETPATH = url.url(+) and utl.url is null
group by stat.SERVLETPATh;
abc
bbc
ccctable b
abcdef
bbcdef我想查出a表中的ccc