Solved

using greater than function in db2

Posted on 2009-04-07
3
1,744 Views
Last Modified: 2012-05-06
hi friends

i have a query in db2 like this

select A.FIRST_NAME, A.LAST_NAME, count(A.ID)
from schema.USERS A where count(A.ID) > 1
GROUP BY A.FIRST_NAME, A.LAST_NAME;


basically i want to retrieve first names and last names of those who have more than one
Id.


a person can have more than one Id . example data

firstname     lastname     userid

raj                  becker       100
raj                  becker       200
sam                 raian        300

but in the query :: count(A.ID) > 1  doesnt seem to work

any ideas greatly appreciated

thanx
J
0
Comment
Question by:jaggernat
  • 2
3 Comments
 
LVL 32

Accepted Solution

by:
awking00 earned 500 total points
ID: 24090573
See attached.
count.txt
0
 
LVL 10

Author Comment

by:jaggernat
ID: 24090993
that was great!!

thank you.
J
0
 
LVL 32

Expert Comment

by:awking00
ID: 24091029
Glad to help.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now