Is there a way to iterate through an array in SQL not using stored procedures? For instance given:
a | b
--+------
a | {1,2}
I would like to flatten the array into individual rows as in:
a | b
--+---
a | 1
a | 2
Clarification: I am trying to do this in Postgres and am looking for a pure SQL solution as opposed to using stored procedures. Please correct me if I am wrong but I don't think this has been addressed in previous questions. Thanks!