Sql Select Extract Data From Plot