select max(display_row),subset_value
from st_Meta_Field where table_id = 5 AND Display_Row < 500
group by Subset_Value
This SQL chunk returns the max display row and subset that is being used by the table.
select * from st_Meta_Field MF
INNER JOIN st_field F ON MF.Field_ID = F.Field_ID
where F.Table_ID = 5 AND (F.Field_Name = 'XXX' OR F.Field_Name = 'YYY')
AND F.Record_State = 1 AND MF.Record_State = 1
This SQL chunk simply joins the two tables based and returns the data for the two fields.
Ultimately what I would like to do is update the display row for these two fields based on the current max display row is already at.