I have been asked to add a few columns to a report based on account number.
The problem is that several accounts are listed more then once in this report.
The report has over 500 rows, but only 450 account numbers.
Is there a way to force my results to give me duplicate data?
Example:
SELECT
a.AccountNumber,
a.ProgramFlag,
a.ApplicationStatus
FROM
accountInfo as A
WHERE
a.AccountNumber in ('100','101','101','101','102','102','103')
ORDER BY
a.AccountNumber asc
Results:
AccountNumber | Program Flag | ApplicationStatus
------------------------------------------------
100 | 1 | INSTALLED
101 | 0 | CLOSED
102 | 1 | INSTALLED
103 | 0 | INSTALLED
Desired Results:
AccountNumber | Program Flag | ApplicationStatus
------------------------------------------------
100 | 1 | INSTALLED
101 | 0 | CLOSED
101 | 0 | CLOSED
101 | 0 | CLOSED
102 | 1 | INSTALLED
102 | 1 | INSTALLED
103 | 0 | INSTALLED
The desired results would be much easier to add to a custom report by repeating all the information for accounts that appear more than once. Especially one that is 500+ records.