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 7623489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:43:08+00:00 2026-05-31T04:43:08+00:00

Please help me to form the SQL query… I have a table in DB2

  • 0

Please help me to form the SQL query…
I have a table in DB2 i.e. SVA1ARTICLE,

TABLE NAME:

SVA1ARTICLE

Table having the column

ID
KEYWORD1
KEYWORD2
KEYWORD3
KEYWORD4

Requirement:

  1. Need to find out the KEYWORD which is at least repeated 100 times from all 4 individual KEYWORDS COLUMN i.e. also UNIQUE. for ex. budget is the keyword in COL KEYWORD1 and repeated 100 times then result will return budget. same applies with other KEYWORD field.

  2. From result return from the above query we need to find out all the column from same table. i.e. if above query return ‘budget’ as keyword then, we need to find out all the record which having keyword budget and gives us the first 50 latest rows.

Please help your warrior who is the frontier with sword only no extra ammunition in hand.

Thanks,
Gladiator

  • 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-31T04:43:10+00:00Added an answer on May 31, 2026 at 4:43 am

    I agree zxq9 post. You need to normalize your database. Middle time:

    “Normalized” data:

    create view SVA1ARTICLE_N
    as
       select ID, keyword1 as k
       from SVA1ARTICLE union all
       select ID, keyword2 as k
       from SVA1ARTICLE union all
       select ID, keyword3 as k
       from SVA1ARTICLE union all
       select ID, keyword4 as k
       from SVA1ARTICLE 
    

    “Find out the KEYWORD which is at least repeated 100 times from all 4
    individual KEYWORDS COLUMN”

    create view key_100
    as
       select k
       from SVA1ARTICLE_N
       group by k
       having count(*) > 100
    

    “From result return from the above query we need to find out all the
    column from same table. i.e. if above query return ‘budget’ as keyword
    then, we need to find out all the record which having keyword budget
    and gives us the first 50 latest rows.”

    select distinct id
    from SVA1ARTICLE_N
    where k in (select k from key_100)
    

    This query returns ID for rows that match your criteria, be free to complete your self the query getting last 50 rows from SVA1ARTICLE source table.

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

Sidebar

Related Questions

Please help the SQL Query in LINQ form - C# .NET 3.5 select distinct
Please help! I have some form elements in a div on a page: <div
Please help! Background info I have a WPF application which accesses a SQL Server
I have a SQL Table with the following columns: PROFILE ---------------------------------- Name | DateOfBirth
I know I'm not asking this quite right, either. Please help me better form
Possible Duplicate: Checking for an SQL result in VB.NET I have login form which
Please can anyone help me with this? I have 2 tables, location and tickets
Please help me out, I am working on a Project Xyz having the mapView
I have a window form with a help button. When user click on this
I want write an win-form application to convert data from foxpro table into sql

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.