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

  • SEARCH
  • Home
  • 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 8257583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T02:14:44+00:00 2026-06-08T02:14:44+00:00

Here is my table data from which i want to find a specific id

  • 0

Here is my table data from which i want to find a specific id by comparing multiple rows..

onetsoc_code    element_id   data_value

11-1011.00      1.B.1.a      1.33
11-1011.00      1.B.1.b      2.00
11-1011.00      1.B.1.c      2.67
11-1011.00      1.B.1.d      3.67
11-1011.00      1.B.1.e      7.00
11-1011.00      1.B.1.f      5.33
11-1011.00      1.B.1.g      5.00
11-1011.00      1.B.1.h      6.00
11-1011.00      1.B.1.i      0.00
11-1021.00      1.B.1.a      1.33
11-1021.00      1.B.1.b      1.33
11-1021.00      1.B.1.c      1.00
11-1021.00      1.B.1.d      3.33
11-1021.00      1.B.1.e      7.00
11-1021.00      1.B.1.f      3.67
11-1021.00      1.B.1.g      5.00
11-1021.00      1.B.1.h      6.00
11-1021.00      1.B.1.i      4.00
11-1031.00      1.B.1.a      1.00
11-1031.00      1.B.1.b      3.67
11-1031.00      1.B.1.c      3.67
11-1031.00      1.B.1.d      4.67
11-1031.00      1.B.1.e      7.00

This is my table so i want those onetsoc_code where the

1.B.1.g      5.00
1.B.1.h      6.00
1.B.1.i      4.00

If you look at the table then you will find 11-1021.00 is the result which i want.

So this is the logic what i want you for got 1.B.1.a to 1.B.1.f. I only want to compare three rows at a moment and want the single onetsoc_code associated with those data.

The rows with 1.B.1.g, 1.B.1.h, 1.B.1.i is available for all onetsoc_code so i just need those onetsoc_code which has above given condition like again,

1.B.1.g      5.00
1.B.1.h      6.00
1.B.1.i      4.00
  • 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-06-08T02:14:47+00:00Added an answer on June 8, 2026 at 2:14 am

    You can group by onetsoc_code and filter for those groups that contain three DISTINCT records:

    SELECT   onetsoc_code
    FROM     mytable
    WHERE    (element_id = '1.B.1.g' AND data_value = 5.00)
          OR (element_id = '1.B.1.h' AND data_value = 6.00)
          OR (element_id = '1.B.1.i' AND data_value = 4.00)
    GROUP BY onetsoc_code
    HAVING   COUNT(DISTINCT element_id, data_value) = 3
    

    See it on sqlfiddle.

    Of course, if uniqueness is guaranteed one can save the expense of the DISTINCT operation and just use plain old COUNT(*) instead.

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

Sidebar

Related Questions

I want to insert my data which is stored in a sqlite table, to
Ok, here's the condensed form. I have three main tables to draw data from:
Data: Here is sample table(TableA) data ID StartTime EndTime 1 2012-03-22 06:00:00.000 2012-03-22 06:30:00.000
Lets say we have a table here, populated with the following data: acc_id1 acc_id2
Some easy points for somebody here, take the following table of data: EventCode ProcessId
Here is a table structure (e.g. test): Field Name Data Type id BIGINT (20)
Here is sample data <table class=sparql border=1> <tr> <th>abstract</th></tr> <tr> <td> Cologne is Germany&#39;s
Here is the sample data for test table I have [childId] [parentId] [present] 1
I have encountered a problem of placing data into the Table View. Here is
My html is like this <div id=rsContainer> <table id=rsTable><!-- DATA HERE --></table> </div> and

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.