vizagpower Posted July 12, 2016 Report Posted July 12, 2016 im trying to update a table based on the below logic , but its failing , any idea where im going wrong ?? UPDATE uaimage_test SET imagegen_flag = ( CASE WHEN datediff(SS,frr.dateEnd,ua.imagegen_dt) <= 120 THEN 0 ELSE 1 END ) FROM uas.fileread_files ff inner join uaimage_test ua on ff.individual_id=ua.ind_no inner join uas.fileread_reads frr on frr.ff_id=ff.id where docType='RDST' and frr.dateEnd is not null and ff.id in ( select id from uas.fileread_files where lu_semester=48) Quote
SlMHAM Posted July 12, 2016 Report Posted July 12, 2016 Sharma ni pilichi o soda kottivvamanu chebuta Quote
vizagpower Posted July 12, 2016 Author Report Posted July 12, 2016 1 minute ago, SlMHAM said: Sharma ni pilichi o soda kottivvamanu chebuta baa whats ur old id , pm me Quote
VCR Posted July 12, 2016 Report Posted July 12, 2016 2 minutes ago, vizagpower said: im trying to update a table based on the below logic , but its failing , any idea where im going wrong ?? UPDATE uaimage_test SET imagegen_flag = ( CASE WHEN datediff(SS,frr.dateEnd,ua.imagegen_dt) <= 120 THEN 0 ELSE 1 END ) FROM uas.fileread_files ff inner join uaimage_test ua on ff.individual_id=ua.ind_no inner join uas.fileread_reads frr on frr.ff_id=ff.id where docType='RDST' and frr.dateEnd is not null and ff.id in ( select id from uas.fileread_files where lu_semester=48) error em osthondi ? Quote
vizagpower Posted July 12, 2016 Author Report Posted July 12, 2016 Just now, VCR said: error em osthondi ? error ravatledu , but not updating the way i wanted Quote
SlMHAM Posted July 12, 2016 Report Posted July 12, 2016 3 minutes ago, vizagpower said: im trying to update a table based on the below logic , but its failing , any idea where im going wrong ?? UPDATE uaimage_test SET imagegen_flag = ( CASE WHEN datediff(SS,frr.dateEnd,ua.imagegen_dt) <= 120 THEN 0 ELSE 1 END ) FROM uas.fileread_files ff inner join uaimage_test ua on ff.individual_id=ua.ind_no inner join uas.fileread_reads frr on frr.ff_id=ff.id where docType='RDST' and frr.dateEnd is not null and ff.id in ( select id from uas.fileread_files where lu_semester=48) idhi pani chestadantava?? Quote
vizagpower Posted July 12, 2016 Author Report Posted July 12, 2016 2 minutes ago, SlMHAM said: idhi pani chestadantava?? i mean if , if duration less than 120 sec , i need to reset it to 0, am i missing something ??? just checked , case is working fine Quote
SlMHAM Posted July 12, 2016 Report Posted July 12, 2016 Just now, vizagpower said: i mean if , if duration less than 120 sec , i need to reset it to 0, am i missing something ??? asalu failure error endho post cheste janalaki easy avutundi ekkada dobbutondo ani Quote
VCR Posted July 12, 2016 Report Posted July 12, 2016 4 minutes ago, vizagpower said: error ravatledu , but not updating the way i wanted first aa case statement run chesi chudu work aithunnada ? Quote
vizagpower Posted July 12, 2016 Author Report Posted July 12, 2016 1 minute ago, VCR said: first aa case statement run chesi chudu work aithunnada ? yes ,its fine Quote
4Vikram Posted July 12, 2016 Report Posted July 12, 2016 6 minutes ago, SlMHAM said: asalu failure error endho post cheste janalaki easy avutundi ekkada dobbutondo ani fail aitaledu update aitaledu antundu kada Quote
VCR Posted July 12, 2016 Report Posted July 12, 2016 Just now, 4Vikram said: fail aitaledu update aitaledu antundu kada akkada select run aithunnadi antunnadu malla update kakpovadam endi same case statement tho Quote
SlMHAM Posted July 12, 2016 Report Posted July 12, 2016 5 minutes ago, vizagpower said: yes ,its fine 3 minutes ago, 4Vikram said: fail aitaledu update aitaledu antundu kada 2 minutes ago, VCR said: akkada select run aithunnadi antunnadu malla update kakpovadam endi same case statement tho sare neeku maaku sync avatle gani.. Single update badulu randu rayi... case statement badulu where use cheyyi... oka update statement with flag = 0 when datediff <=120 inkoti update statement with flag = 1 when datediff >120 7 minutes ago, vizagpower said: yes ,its fine Select CASE WHEN datediff(SS,frr.dateEnd,ua.imagegen_dt) <= 120 THEN 0 ELSE 1 END AS testFROM uas.fileread_files ff inner join uaimage_test ua on ff.individual_id=ua.ind_noinner join uas.fileread_reads frr on frr.ff_id=ff.id where docType='RDST' and frr.dateEnd is not null and ff.id in ( select id from uas.fileread_files where lu_semester=48) Run cheyyi emustundo cheppu Quote
4Vikram Posted July 12, 2016 Report Posted July 12, 2016 26 minutes ago, VCR said: akkada select run aithunnadi antunnadu malla update kakpovadam endi same case statement tho yeah nenu kuda chusna run aindi bane mari update enduku avaledu oo no idea Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.