
Here is a sample table that has three columns — Col1, Col2 and Col3. Columns Col1 and Col3 are duplicated in multiple rows. The Col2 column has a numeric value that can be different for each row.
Col1 Col2 Col3 —- —- —- ABC 12 xyz ABC 32 xyz ABC 43 xyz DEF 12 uvw DEF 32 uvw DEF 65 uvw GHI 12 rst GHI 76 rst GHI 115 rst
Please show us how you would want your query to display those rows. If my example does not fit your requirement, then please provide an example that would work and show us how the query should report that example.
Thank you.
Tom

If this doesn’t make the OP provide more details, nothing will.

…nothing will.
We’ll find out, eh? I work at eliciting details, but it’s not a particularly fruitful effort. Every once in a while, though…
Tom

Hi, as sample I have 2 columns in a table, if records are display’s in such way,
Col1 Col2
AAA aaa
AAA aaa
BBB bbb
CCC bbb
CCC ccc
AAA aaa
BBB bbb
Like to view data in such format
Col1 Col2
AAA aaa
BBB bbb
CCC bbb
CCC ccc
like to find out same…

You almost certainly want a Summary Query, but I can’t determine what product you are using. Neither the Query for iSeries nor the Query Manager products have a menu option nor screen labeled ‘Query Definition Option’ that I can see.
You would set both Col1 and Col2 as ‘Break’ columns and choose the summary output type.
What version of i5/OS are you running? How do you get into the query function? (If you know the name of the query product, that will help.)
I might be better able to connect to a configuration that matches yours if I know what to work with.
Tom

BTW, this would be much simpler with a basic SQL SELECT DISTINCT… query.
SELECT DISTINCT Col1, Col2 FROM mytable
Tom

Thanks Dan, It works


















