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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:04:43+00:00 2026-05-13T17:04:43+00:00

I am having data like below Table1 data: Attr1 Attr2 36 L 37 L

  • 0

I am having data like below

Table1 data:

Attr1    Attr2
36 L
37 L
38 L
39 L
40 L
41 L
42 L
43 L
44 L
46 L
48 L
50 L
52 L
54 L
56 L
58 L
60 L
62 L
36 P
37 P
38 P
39 P
40 P
41 P
42 P
43 P
44 P
46 P
48 P
50 P
52 P
54 P
56 P
58 P
60 P
62 P
36 PL
37 PL
38 PL
39 PL
40 PL
41 PL
42 PL
43 PL
44 PL
46 PL
48 PL
50 PL
52 PL
54 PL
56 PL
58 PL
60 PL
62 PL
36 PS
37 PS
38 PS
39 PS
40 PS
41 PS
42 PS
43 PS
44 PS
46 PS
48 PS
50 PS
52 PS
54 PS
56 PS
58 PS
60 PS
62 PS
36 R
37 R
38 R
39 R
40 R
41 R
42 R
43 R
44 R
46 R
48 R
50 R
52 R
54 R
56 R
58 R
60 R
62 R
36 S
37 S
38 S
39 S
40 S
41 S
42 S
43 S
44 S
46 S
48 S
50 S
52 S
54 S
56 S
58 S
60 S
62 S
36 XL
37 XL
38 XL
39 XL
40 XL
41 XL
42 XL
43 XL
44 XL
46 XL
48 XL
50 XL
52 XL
54 XL
56 XL
58 XL
60 XL
62 XL

And table2 like below:

ItemCode          Attr1     Attr2
ITEM-000001 43 S
ITEM-000001 52 L
ITEM-000006 42 R
ITEM-000006 44 R
ITEM-000009 56 R

there will be more items in table2.

How i can get output in which i will get the all rows of table1 who are having same ‘Attr2’
say for example ‘ITEM-000001’ having two Attr2 – ‘S’ & ‘L’ so it will display as shown below:

Attr1    Attr2       ItemCode
    36 L           ITEM-000001
    37 L           ITEM-000001
    38 L           ITEM-000001
    39 L           ITEM-000001
    40 L           ITEM-000001
    41 L           ITEM-000001
    42 L           ITEM-000001
    43 L           ITEM-000001
    44 L
    46 L
    48 L
    50 L
    52 L
    54 L
    56 L
    58 L
    60 L
    62 L           ITEM-000001
    36 S           ITEM-000001
    37 S
    38 S
    39 S
    40 S
    41 S
    42 S
    43 S
    44 S
    46 S
    48 S
    50 S
    52 S
    54 S           ITEM-000001
    56 S           ITEM-000001
    58 S           ITEM-000001
    60 S           ITEM-000001
    62 S           ITEM-000001
  • 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-13T17:04:44+00:00Added an answer on May 13, 2026 at 5:04 pm

    Hi All thank you for all your efforts & time for my question, here is the query which will give me the expected result. Thank you very much to all.

    SELECT DISTINCT T2.ItemCode, T1.Attr1, T2.Attr2
    FROM  
        (
           SELECT Attr1
           FROM Table1
        ) AS T1
    
        CROSS JOIN
    
        ( 
           SELECT ItemCode, Attr2
           FROM Table2
        ) AS T2
    ORDER BY 1, 2, 3
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having data as like below. I need to plot graph based on region.
i have two sheets having data like this sheet1 : **A** **B** **C** 752
I am having my core data model like this: EntityA <---->> EntityB <<----> EntityC
I'm having trouble rendering out a template, my data looks like this: var data
i am having an form for uploading an excel file like <form enctype=multipart/form-data action=http://localhost/joomla/Joomla_1.5.7/index.php?option=com_jumi&fileid=7
I'm having problems with this code below. I would like someone tell me why
I have table tblTask with data like below. TID StartTime Uid WId 1 2011-06-06
I am having data of table dummy as below: Name amount amount1 ----------------------------------------------- mahesh
I have two tables table1 and table2. Table2 is having less number of rows
I am having problem in opening and viewing data in my SSCE table. There

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.