Sql 光标的移动?我想是的。仍然可以在两个游标之间进行联接吗?如果是这样的话,语法会是什么样子?从我在文档中看到的情况来看,使用游标的语法与查询表的语法似乎有很大的不同。这就是你要找的吗?因为根据你所说,光标不是适合你的解决方案。不客气。我刚刚添加了一个简短的查

Sql 光标的移动?我想是的。仍然可以在两个游标之间进行联接吗?如果是这样的话,语法会是什么样子?从我在文档中看到的情况来看,使用游标的语法与查询表的语法似乎有很大的不同。这就是你要找的吗?因为根据你所说,光标不是适合你的解决方案。不客气。我刚刚添加了一个简短的查,sql,postgresql,Sql,Postgresql,光标的移动?我想是的。仍然可以在两个游标之间进行联接吗?如果是这样的话,语法会是什么样子?从我在文档中看到的情况来看,使用游标的语法与查询表的语法似乎有很大的不同。这就是你要找的吗?因为根据你所说,光标不是适合你的解决方案。不客气。我刚刚添加了一个简短的查询作为奖励:-) select distinct cust_num into t1 from all_visits_x_cust where date > '06/02/2015' and date <= '07/02/2015


光标的移动?我想是的。仍然可以在两个游标之间进行联接吗?如果是这样的话,语法会是什么样子?从我在文档中看到的情况来看,使用游标的语法与查询表的语法似乎有很大的不同。这就是你要找的吗?因为根据你所说,光标不是适合你的解决方案。不客气。我刚刚添加了一个简短的查询作为奖励:-)
select distinct cust_num into t1 
from all_visits_x_cust 
where date > '06/02/2015'
and date <= '07/02/2015' 
and cust_num > 9999;

select distinct cust_num into t1_2 
from cc_calls_x_cust 
where date = '06/02/2015' 
and cust_num > 9999);

select count(*) as post_call_visitors 
into v1 
from t1_2 join t1 
on t1.cust_num = t1_2.cust_num);
select count(*) as post_call_visitors 
into temp v1
from (
        select distinct cust_num
        from all_visits_x_cust 
        where date > '06/02/2015'
        and date <= '07/02/2015' 
        and cust_num > 9999
    ) as t1
join (
        select distinct cust_num 
        from cc_calls_x_cust 
        where date = '06/02/2015' 
        and cust_num > 9999
     ) as t1_2
on t1.cust_num = t1_2.cust_num; 
select count(distinct cust_num) as post_call_visitors 
from cc_calls_x_cust 
where date = '06/02/2015' 
and cust_num > 9999
and cust_num in (
        select cust_num 
        from all_visits_x_cust 
        where date > '06/02/2015'
        and date <= '07/02/2015' 
    ); 
with t1 as (
    select distinct cust_num
    from all_visits_x_cust 
    where date > '06/02/2015'
    and date <= '07/02/2015' 
    and cust_num > 9999
    ),
t1_2 as (
    select distinct cust_num into t1_2 
    from cc_calls_x_cust 
    where date = '06/02/2015' 
    and cust_num > 9999
    )
select count(*) as post_call_visitors 
from t1_2 
join t1 
on t1.cust_num = t1_2.cust_num;