You can also add COUNT(*) to your query to see how many rows are duplicated and use a HAVING to see just the duplicated rows.
--
rk
-----Original Message----- From: ProfoxTech profoxtech-bounces@leafe.com On Behalf Of mbsoftwaresolutions@mbsoftwaresolutions.com Sent: Friday, March 30, 2018 12:37 AM To: profoxtech@leafe.com Subject: Re: Unexpected results from a group by clause
On 2018-03-29 23:00, Joe Yoder wrote:
I have an SQL select statement that includes a group by clause to order the output for reporting. It gets its data from a table that potentially includes legitimate duplicate records.
SELECT account, date, memo, paid_amoun; FROM QB; GROUP BY account, date, memo, paid_amoun; INTO CURSOR det
I happened to discover that the output of the select statement does not include duplicate records. Is this expected behavior? If so , how should one group data with duplicate records?
Thanks in advance,
Joe
Hi Joe,
Replace the GROUP BY with the ORDER BY clause and it won't drop any records.
hth, --Mike