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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:15:16+00:00 2026-06-17T16:15:16+00:00

I have 2 different tables which look something like the following: ——–Table 1——————————————————— Cat1

  • 0

I have 2 different tables which look something like the following:

--------Table 1---------------------------------------------------------
Cat1           Cat2          Cat3        Value1
a                             d1           13
b              e1                          13
a              e2             d1           13
c                             d2           13
a              e1                          13
a                             d1           13
--------Table 2 -------------------------------------------------
Cat1           Cat2           Cat3       Value2    
a              e2             d1           113
c                             d2           132    
a                             d1           134
a                             d1           131
b              e1                          113
a              e1                          133

The Cat1 and Cat2 for above tables are same but might not be in same order. I want to combined both tables above so that desired table looks like following:

--------Desired Table---------------------------------------------------------
Cat1           Cat2          Cat3        Value1      Value2
a                             d1           13        134 
b              e1                          13        113
a              e2             d1           13        113
c                             d2           13        132
a              e1                          13        113
a                             d1           13        134

I am using apparently an older version of sybase.

Thanks!!

  • 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-17T16:15:17+00:00Added an answer on June 17, 2026 at 4:15 pm

    Just try this one (from my ANSI SQL experience):

        SELECT a.cat1,
               a.cat2,
               a.cat3,
               a.value1,
               b.value2
        FROM tab1 a
        LEFT OUTER JOIN
          (SELECT cat1,
                  cat2,
                  cat3,
                  max(value2) value2
           FROM tab2
           GROUP BY cat1,
                    cat2,
                    cat3) b ON a.cat1 = b.cat1
        AND a.cat2 = b.cat2
        AND a.cat3 = b.cat3;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 3 different transaction tables, which look very similar, but have slight differences.
I have two tables that look like this: CREATE TABLE table1 (user_id int, the_date
I have two different tables from which I need to pull data blogs which
I have a csv file from which I have to populate different tables in
I have two tables which are used to store details of different types of
Hi i'm trying to create a league table in which i have several different
I have a table which is zebra-striped (different background color for each odd rows).
I have a SQL Server table which has 625 columns created with different datatypes
I have a payment_types table in which you can enter different payment types such
I have two different tables, lead and click. I would like to query MySQL

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.