In PostGIS, I am trying to get the elements from first table(A) that intersect with bounding box of second table(B) . I get the error using the query below. What would be the correct syntax.
SELECT A.* from A,B where ST_Intersects(A.geom,SELECT ST_Extent(geom) as table_extent FROM B);
ERROR: syntax error at or near "SELECT" LINE 1: ...from rivers,india where ST_Intersects(rivers.geom,SELECT ST_... ^ ********** Error **********
ERROR: syntax error at or near "SELECT" SQL state: 42601 Character: 67