I want to convert the mentioned oracle query to PostgreSQL for getting the count of table
select count(*) from student connect by prior std_id=std_roll
I want to convert the mentioned oracle query to PostgreSQL for getting the count of table
select count(*) from student connect by prior std_id=std_roll
Oracle's
connect by
can be re-written as a a recursive common table expression in standard SQL (and Postgres):This however does not really make sense. The above is a complicated way of writing
select count(*) from student
(assuming there is a foreign key betweenstd_roll
andstd_id
)