Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 27759

cursor - forum topic by mensssanvi

$
0
0

I'm trying to create a cursor with the following statement but not sure from where to start. Please help!

SELECT 
tom.wh_no AS tom_wh_acc
,tom.wh_cust AS tom_wh_cust
,bob.wh_cust AS bob_wh_cust
,bob.clustering 
,tom.clus_no

FROM 
(
SELECT 
--Wh_ACC_No , 
MIN(cluster_no) AS clustering
,wh_cust
FROM 
t_mortg_rel_temp
GROUP BY 2
) bob
, t_mortg_rel_temp tom
WHERE bob.wh_cust = tom.wh_cust
AND bob.clustering <> tom.clus_no
ORDER BY bob.clustering

 

Forums: 

Viewing all articles
Browse latest Browse all 27759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>