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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:01:41+00:00 2026-05-27T22:01:41+00:00

I have two columns, confid1 and confid2 . They both have the same data

  • 0

I have two columns, confid1 and confid2. They both have the same data type.

I somehow need to bring confid2 into confid1, but not concatenate them. Instead, insert it into a new line under confid1.

Original:

confid1     confid2
AACII1C1    AACII1C2

I have tried using UNION such as below:

(SELECT confid1 as ID1 FROM dyndomrun)
UNION
(SELECT confid2 as ID2 FROM dyndomrun)

It then returns the combination of confid1 and confid2 inside confid1, which is what I was looking for, as below:

confid1
AACII1C1
AACII1C2

Now, the problem is that one of the columns in another table links up with confid1 and confid2, but it is all in a single column but multiple rows.

Right now, I have tried using the same UNION method, just adding the pdbcode into the code, such as below:

(SELECT confid1 as id1, conformer.pdbcode from dyndomrun, conformer where dyndomrun.confid1 = conformer.id)
UNION
(SELECT confid2 as id2, conformer.pdbcode from dyndomrun, conformer where dyndomrun.confid1 = conformer.id)

And it returns duplicate “pdbcode” values when it’s not suppose to, as below:

confid1,    pdbcode
AACII1C1    2a4n
AACII1C2    2a4n

I want it to select and return a pdbcode column related to confid1 and confid2 such as below:

confid1,    pdbcode
AACII1C1    2a4n
AACII1C2    1b87
  • 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-27T22:01:42+00:00Added an answer on May 27, 2026 at 10:01 pm

    Change your 2nd JOIN to match using confid2?

    (SELECT confid1 as id1, conformer.pdbcode 
    from dyndomrun JOIN conformer 
               ON dyndomrun.confid1 = conformer.id)
    UNION
    (SELECT confid2 as id2, conformer.pdbcode 
     from dyndomrun JOIN conformer 
               ON dyndomrun.confid2 = conformer.id)
    

    Note: updated to use explicit JOIN syntax

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

Sidebar

Related Questions

I have two columns, they are both floated to the left. Inside the left
I have two columns. ColA and ColB contains char(10) with data 20090520 and 20090521.
I have two columns that are joined together on certain criteria, but I would
I have two columns in a table. I need to merge these two columns
I have two columns of numbers. Both are 1 to 5. I want to
I have two columns in a text file. I read them into Python into
We have two columns in a database which is currently of type varchar(16). Thing
I have two columns but the codition I would like is to be evaluated
Here's my situation. Say I have two columns of data containing different elements. I'd
I have two columns in a location model that should both associate with the

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.