My data looks like this

```
ID   Source Destination FLAG

1    A      B           Y

2    C      D           N

```

Resultant data is based on below logic

if FLAG='Y' then resultant query will lhave two rows with source and destination columns swaped else only one row

```
ID   Source Destination FLAG

1    A      B            Y

1    B      A            Y

2    C      D            N

```