Hi

In below data A will come only once and D will always be followed by B. D can be 2 or 3 in number after B.
I need to write a query so that slect query comes like

ABD, ABDDD , ABD and so on . All B,D are different from each other and should be in order.
Here A will always with the B and D will always followed by B. Its vwery complex for me . Can anybody please help on this.

A
B
D
B
D
B
D
B
D
B
D
B
D
D
B
D
B
D
B
D
D
B
D
D
B
D
D