Get information from database

hello,
I can find the points in the polygon in the picture from the database.
How can I write this result in the field_farm_area field or the field I will create myself?

e.g. log record 97
this is my query–>

select name from taxonomy_term_data
where tid in(
select x.entity_id
from(
select point.entity_id,st_contains(polygon.geom,point.geom) sonuc
from (select ST_GEOMFROMTEXT(ST_AsText(ST_GeomFromWKB(field_farm_geofield_geom))) as geom,entity_id from field_data_field_farm_geofield where bundle=‘farm_areas’) point,
(select ST_GEOMFROMTEXT(ST_AsText(ST_GeomFromWKB(field_farm_geofield_geom))) as geom from field_data_field_farm_geofield
where entity_id=97) polygon) x
where sonuc=1);

this is the result–>
name
826
853
508
514
515
516
517
518
519
520
521
762
763
805
871

I want to print these numbers on a field or field farm area.
subject if field_farm_area is empty.
In addition, this query will work for every log, here I just gave 97 as an example.

Ah just saw this @compact2 - I assume it’s the same as this topic? Get information from database

Will continue the conversation over there…