Exists in cursor where condition is met
问题 I have created a cursor, that returns some data. I then wish to have an if statement in the returned data that checks if the field 'test_field' exists in the cursor where test_field2='A'. I am struggling to get my syntax correct on the if statement though, and can't find any pointers online. CURSOR test_cur IS SELECT * FROM test where name=pk_name; BEGIN FOR trec IN test_cur LOOP --The following line where my syntax is incorrect IF trec.test_field EXISTS IN test_cur WHERE trec.test_field2 =