Sponsored Content
Top Forums UNIX for Beginners Questions & Answers DB2 Query modification to remove duplicate values using LISTAGG function Post 303036928 by Corona688 on Wednesday 17th of July 2019 01:17:10 PM
Old 07-17-2019
I don't think you should specify "WITHIN GROUP" more than once, that restriction would end up applying to all columns, put it at the end.
This User Gave Thanks to Corona688 For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Db2 query with script

Hi All, I want to connect two tables in DB2 using shell script and then compare the contents of two tables field by field.and i should return on the screen the un matched records .. Could any one please help me in connecting database tables using Unix and retriving data from the same. (1 Reply)
Discussion started by: kanakaraju
1 Replies

2. UNIX for Dummies Questions & Answers

[SOLVED] remove lines that have duplicate values in column two

Hi, I've got a file that I'd like to uniquely sort based on column 2 (values in column 2 begin with "comp"). I tried sort -t -nuk2,3 file.txtBut got: sort: multi-character tab `-nuk2,3' "man sort" did not help me out Any pointers? Input: Output: (5 Replies)
Discussion started by: pathunkathunk
5 Replies

3. Shell Programming and Scripting

awk file to read values from Db2 table replacing hard coded values

Hi, I want to replace a chain of if-else statement in an old AWK file with values from Db2 table or CSV file. The part of code is below... if (start_new_rec=="true"){ exclude_user="false"; user=toupper($6); match(user, "XXXXX."); if (RSTART ==2 ) { ... (9 Replies)
Discussion started by: asandy1234
9 Replies

4. Shell Programming and Scripting

Remove duplicate values with condition

Hi Gents, Please can you help me to get the desired output . In the first column I have some duplicate records, The condition is that all need to reject the duplicate record keeping the last occurrence. But the condition is. If the last occurrence is equal to value 14 or 98 in column 3 and... (2 Replies)
Discussion started by: jiam912
2 Replies

5. Shell Programming and Scripting

Implementing Listagg like function in shell

Hi, Basically what I am trying to do is making multiple fields of the same type comma-separated. i.e. for a data like this: B00000 abc B00001 abc,def B00001 ghi B00001 jkl B00002 abc B00002 def B00003 xyz Output should be like: B00000 abc B00001 abc,def,ghi,jkl... (20 Replies)
Discussion started by: prohank
20 Replies

6. Shell Programming and Scripting

Filter file to remove duplicate values in first column

Hello, I have a script that is generating a tab delimited output file. num Name PCA_A1 PCA_A2 PCA_A3 0 compound_00 -3.5054 -1.1207 -2.4372 1 compound_01 -2.2641 0.4287 -1.6120 3 compound_03 -1.3053 1.8495 ... (3 Replies)
Discussion started by: LMHmedchem
3 Replies

7. Shell Programming and Scripting

Remove duplicate values in a column(not in the file)

Hi Gurus, I have a file(weblog) as below abc|xyz|123|agentcode=sample code abcdeeess,agentcode=sample code abcdeeess,agentcode=sample code abcdeeess|agentadd=abcd stereet 23343,agentadd=abcd stereet 23343 sss|wwq|999|agentcode=sample1 code wqwdeeess,gentcode=sample1 code... (4 Replies)
Discussion started by: ratheeshjulk
4 Replies

8. Shell Programming and Scripting

Find duplicate values in specific column and delete all the duplicate values

Dear folks I have a map file of around 54K lines and some of the values in the second column have the same value and I want to find them and delete all of the same values. I looked over duplicate commands but my case is not to keep one of the duplicate values. I want to remove all of the same... (4 Replies)
Discussion started by: sajmar
4 Replies

9. Programming

DB2 Query -Convert multi values from column to rows

Hi Team I am using DB2 artisan tool and struck to handle multi values present in columns that are comma(,) separated. I want to convert those column values in separate rows . For example : Column 1 Column2 Jan,Feb Hold,Sell,Buy Expected Result Column1 ... (3 Replies)
Discussion started by: Perlbaby
3 Replies

10. Programming

DB2 Query to pick hierarchy values

Dear Team I am using DB2 v9 . I have a condition to check roles based on hierarchies like below example. 1.Ramesh has Roles as "Manager" and "Interviewer" 2.KITS has Roles as "Interviewer" 3.ANAND has Roles as "Manager" and "Interviewer" select * FROM TESTING NAME ... (6 Replies)
Discussion started by: Perlbaby
6 Replies
Channel(3pm)						User Contributed Perl Documentation					      Channel(3pm)

NAME
Coro::Channel - message queues SYNOPSIS
use Coro; $q1 = new Coro::Channel <maxsize>; $q1->put ("xxx"); print $q1->get; die unless $q1->size; DESCRIPTION
A Coro::Channel is the equivalent of a unix pipe (and similar to amiga message ports): you can put things into it on one end and read things out of it from the other end. If the capacity of the Channel is maxed out writers will block. Both ends of a Channel can be read/written from by as many coroutines as you want concurrently. You don't have to load "Coro::Channel" manually, it will be loaded automatically when you "use Coro" and call the "new" constructor. $q = new Coro:Channel $maxsize Create a new channel with the given maximum size (practically unlimited if "maxsize" is omitted). Giving a size of one gives you a traditional channel, i.e. a queue that can store only a single element (which means there will be no buffering, and "put" will wait until there is a corresponding "get" call). To buffer one element you have to specify 2, and so on. $q->put ($scalar) Put the given scalar into the queue. $q->get Return the next element from the queue, waiting if necessary. $q->shutdown Shuts down the Channel by pushing a virtual end marker onto it: This changes the behaviour of the Channel when it becomes or is empty to return "undef", almost as if infinitely many "undef" elements have been put into the queue. Specifically, this function wakes up any pending "get" calls and lets them return "undef", the same on future "get" calls. "size" will return the real number of stored elements, though. Another way to describe the behaviour is that "get" calls will not block when the queue becomes empty but immediately return "undef". This means that calls to "put" will work normally and the data will be returned on subsequent "get" calls. This method is useful to signal the end of data to any consumers, quite similar to an end of stream on e.g. a tcp socket: You have one or more producers that "put" data into the Channel and one or more consumers who "get" them. When all producers have finished producing data, a call to "shutdown" signals this fact to any consumers. $q->size Return the number of elements waiting to be consumed. Please note that: if ($q->size) { my $data = $q->get; ... } is not a race condition but instead works just fine. Note that the number of elements that wait can be larger than $maxsize, as it includes any coroutines waiting to put data into the channel (but not any shutdown condition). This means that the number returned is precisely the number of calls to "get" that will succeed instantly and return some data. Calling "shutdown" has no effect on this number. AUTHOR
Marc Lehmann <schmorp@schmorp.de> http://home.schmorp.de/ perl v5.14.2 2012-04-13 Channel(3pm)
All times are GMT -4. The time now is 06:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy