Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1112875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:46:28+00:00 2026-05-17T02:46:28+00:00

Exmaple: [empid date bookid] ———- 1 5/6/2004 8 2 5/6/2004 8 1 5/7/2004 8

  • 0

Exmaple:

[empid    date      bookid]
----------
1        5/6/2004   8

2        5/6/2004   8

1        5/7/2004   8

1        5/8/2004   6

3        5/8/2004   8

2        5/8/2004   7

In this table,I need to get empid 1 as output..since it has bookid 8 more than once..

thanks in advance..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T02:46:29+00:00Added an answer on May 17, 2026 at 2:46 am

    You can use:

    SELECT DISTINCT id
    FROM table
    GROUP BY empid, bookid
    HAVING COUNT(*) > 1
    

    But it will give you duplicates. If, for example, you have 1-8,1-8,1-9,1-9 you will get 1,1 as output because empid 1 has duplicate bookid’s for two distinct bookid values. You will need to use SELECT DISTINCT to filter out the duplicate empid.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table named OT Hours which has the following column EmpId, Date,
I've got various flash files stored on my server. For this exmaple - here
I have to develop a component which will have a more than 100,000 instances
I have a table emp_skills which has emp_id and skill_id as two columns. Now,
I have the following table schema: RecordId EmpID AbsCode DateFrom DateTo --------------------------------------------------------------- 666542 1511
How can I get certain rows from a table in order? For Example I
Could you helpme to make this exmaple work? I'd like to load a serialized
I'm trying to fetch the XML result from an exmaple query like this: http://maps.googleapis.com/maps/api/directions/xml?origin=Toronto,ON&destination=Manhattan,NY&dirflg=r&sensor=false
Is there any tips/tricks for finding cyclic references of shared_ptr's? This is an exmaple
I have an Insert statement to a table which has a primary key of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.