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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T10:30:34+00:00 2026-05-11T10:30:34+00:00

In the diagram below there is a 1:1 relationship between ‘DodgyOldTable’ and ‘MainTable’. Table

  • 0

In the diagram below there is a 1:1 relationship between ‘DodgyOldTable’ and ‘MainTable’. Table ‘Option’ contains records with ‘OptionVal1’, ‘OptionVal2’ and ‘OptionVal3’ in the ‘OptionDesc’ field. I need to do an insert into MainTable_Option with a select from DodgyOldTable. Something like this:

INSERT MainTable_Option ([MainTableID],[OptionID]) SELECT ID, (CASE WHEN OptionVal1 = 'y' THEN      (SELECT OptionID       FROM Option       WHERE OptionDesc = 'OptionVal1') END FROM DodgyOldTable 

If possible I want to avoid using several different select statements to perform the insert operation.

alt text http://www.freeimagehosting.net/uploads/863f10bf5f.jpg

  • 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. 2026-05-11T10:30:34+00:00Added an answer on May 11, 2026 at 10:30 am
    INSERT    MainTable_Option    (   MainTableID,    OptionID   ) SELECT   d.ID,    o.OptionId FROM   DodgyOldTable d   INNER JOIN Option o ON     (d.OptionVal1 = 'Y' AND o.OptionDesc = 'OptionVal1') OR     (d.OptionVal2 = 'Y' AND o.OptionDesc = 'OptionVal2') OR     (d.OptionVal3 = 'Y' AND o.OptionDesc = 'OptionVal3') 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As you can seen in the diagram below there is a one-to-many relationship between
There's a diagram depicting the difference between traditional MVC and Cocoa MVC here: Cocoa
In a class diagram, is there a way of specifying that a class is
Is there a way to produce a diagram showing existing tables and their relationships
Is there a way to exchange ERD diagram from one tool to other as
Is there a setting in graphviz to generate balanced diagrams like this: correct diagram
On a Use Case diagram can you show things that an actor cannot do,
In an UML component diagram, how does one tag or identify a component as
I want to reverse engineer (import into diagram form) the database definition dump of
I am modeling a class diagram. An attribute of a class is an enumeration.

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.