Need sql query



IBM's flagship relational database management system

Need sql query

Postby supriya saraswat » Tue Nov 04, 2008 6:19 pm

i have following table named winkeys.
ACCT ID ADDR TYPE ADDR ID SEQ NBR WIN KEY WINKEY LAST UPD TS UPDATE USERID PEND STATUS
0010006206204927 BA 05/21/04 18:56:24.444 1 200153211 MRRSN 01/01/04 01:01:01.000 ZNDM900N N
0010006206204927 CL 05/21/04 18:56:24.444 0 200153211 MRRSN 01/01/04 01:01:01.000 ZNDM900N N
0010006206204927 CL 05/21/04 18:56:24.444 1 200153211 MRRSN 01/01/04 01:01:01.000 ZNDM900N N
....................................... .................................. ................................


above one are 3 records of the table winkeys.


now requirement is that i need those account numbers which have addr type =ba and number of occurences of each acct id for such condition must be more than 1.


e.g
for acct-id =0010006206204927
if number of occurences for above one is more than 1 in table and acct -type=ba then display it

i need it urgently..
can anyone help
supriya saraswat
 
Posts: 21
Joined: Mon Jul 07, 2008 3:24 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Need sql query

Postby dick scherrer » Wed Nov 05, 2008 2:22 am

Hello,

If it is urgent, the forum is not the place to seek a solution - things often do not happen quickly here. . .

If the requirement was urgent, the dba or some senior co-worker would be the place to get a quick solution.

You need to post more complete sample data rows. You also need to show what the expected result(s) for the sample rows would be when your query is executed.

You also need to post your query so far and explain what syntax error(s) or undesired results occur. We will help you with your code, but not write it all for you.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post