Change Sql query to DB for prescription details