I need to get gid, area and geometry of table1 which are intersecting with 200 buffer of table2. I tried to structure the query. Please refer below:
create table SMI_1 as
SELECT ST_Buffer(geom, 200) from table2;
create table SAH_2 as
SELECT a.gid,a.shape_area, a.geom
FROM table1 a
INNER JOIN SMI_1 b ON ST_Intersects(a.geom, b.st_buffer);
With this I am not getting desired output. It is not clipping the features of table1 with the shape of the table2.
ST_Intersects
andST_Intersection
.