Postgresql Select Data From Another Sql Interview Query