Problem solve Get help with specific problems with your technologies, process and projects.

SQL statement count>1

Need test data in a hurry? Need to find data that has more than one (or more than any number) detail per header? Here's how to do it.

Need test data in a hurry? Need to find data that has more than one (or more than any number) detail per header? Here's how to do it with multiple fields or single fields.

Use the following code:

count(*) > 0, multiple flds SELECT fld1,fld2,fldnn, count(*) as Number_of_Dupes FROM lib/file GROUP BY fld1,fld2,fldnn HAVING count(*) > 1 ORDER BY fld1,fld2,fldnn

For a single field use Fld1.

==================================
MORE INFORMATION ON THIS TOPIC
==================================

The Best Web Links: tips, tutorials and more.

Visit the ITKnowledge Exchange and get answers to your developing questions fast.

Ask the Experts yourself: Our application development gurus are waiting to answer your programming questions.


Dig Deeper on Windows on iSeries

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataCenter

Close