Hello
gpssana,
Your expected and actual output are just one part of it. We also expect some code that we can execute in an isolated manner to reproduce your results. In your case, your sql only says that you're querying for some columns, performing an UNION ALL to collapse results with another subquery. That doesn't tell us how your data is structured. Depending on your data, your query may be the culprit or you may have used a different DBI method call. We don't see that yet. Also, take a look at Corion's reply here.