I'm confused why this:
<sql "select id crosstab_id from crosstab where filter_id=$thisFilterId">
<sql "delete from result where crosstab_id=$crosstab_id"></sql>
</sql>
does not give identical results as this:
<sql "delete from result where crosstab_id in (select id from crosstab where filter_id=$thisFilterId)"></sql>
The first does what I want it to do. Namely, it deletes all the rows from table "result" if the related row in table "crosstab" has the value $thisFilterId in the filter_id column. In one particular case there were 11 such rows in table "result". The second only deletes one row.
Is this related to the change in the IN operator in version 7, or has this behavior been there all along, and I've only just noticed it? I have no problem using the first code construct, but the subquery just "feels" more natural to me.
Thanks
<sql "select id crosstab_id from crosstab where filter_id=$thisFilterId">
<sql "delete from result where crosstab_id=$crosstab_id"></sql>
</sql>
does not give identical results as this:
<sql "delete from result where crosstab_id in (select id from crosstab where filter_id=$thisFilterId)"></sql>
The first does what I want it to do. Namely, it deletes all the rows from table "result" if the related row in table "crosstab" has the value $thisFilterId in the filter_id column. In one particular case there were 11 such rows in table "result". The second only deletes one row.
Is this related to the change in the IN operator in version 7, or has this behavior been there all along, and I've only just noticed it? I have no problem using the first code construct, but the subquery just "feels" more natural to me.
Thanks