Solved

using greater than function in db2

Posted on 2009-04-07
3
1,754 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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL Developer 6 75
run sql script from putty 4 194
How to drop system generated virtual column in a table in12c 15 123
Help with Oracle IF statment 5 37
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…

696 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