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:
-
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.
-
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
I agree zxq9 post. You need to normalize your database. Middle time:
“Normalized” data:
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.