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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:47:21+00:00 2026-05-12T11:47:21+00:00

you have this 2 tables: table1 ————- id fromId fromOtherTableId person and Table2 ————-

  • 0

you have this 2 tables:

table1
-------------
id
fromId
fromOtherTableId
person

and

Table2
-------------
OtherTableId    
Person

first question

this query work fine

select t.id
from table1 as t inner join Table2 as a on t.fromOtherTableId=a.OtherTableId    
where a.Person = 54
union
select t1.id
from table1 as t1 inner join Table1 as t2 on t1.fromId=t2.fromId
where t2.Person = 54

how to remove the union so the query would still be working?


second question

how would you manage the fact that you cannot create an entry in table1 where table2.fromothertableid(person) would be put into table1.person(circular thing)

same with the fact that you cannot create an entry in table1 where table1.fromid(person) would be put into table1.person(circular thing)

this would be good:

table1
---------------
1, null, 1 , 100
2, 1, null , 200

table2
--------------
1, 200

this wouldn’t be good(between **)

table1
---------------
1, null, 1 , 100
2, 1, null , 200
**3, 1, null , 100**
**4, null, 1, 200**

table2
--------------
1, 200
  • 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-12T11:47:21+00:00Added an answer on May 12, 2026 at 11:47 am

    Question 1:

    select t.id
    from table1 as t 
       join Table1 as a on a.fromId = t.fromId
       join Table2 as o on o.otherTableId = t.fromOtherTableId
    where  54 In (a.Person, o.person)
    

    Queston 2: I have many questions about this schema… on the surface it does not seem right, but I don’t know what business model it attempts to represent… Can you elaborate ?

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

Sidebar

Related Questions

I have 3 tables - Table1 Table2 and Table3 I want to change this
I have two tables table1 and table2, i need to write a select query
I have three tables. This query will write down the right answer (x-lines for
I have two tables (well, two relevant for this question) : Bets (holds the
I have 3 tables Table1 (with 1020690 records), Table2(with 289425 records), Table 3(with 83692
This is probably very easy, but it's Monday morning. I have two tables: Table1:
I have two tables TABLE1 and TABLE2 with identical structures. I need a trigger
I have two tables Table1: ColumnA (varchar) Table2: ColumnB (varchar) I need to get
I have two tables, table1 ( Id, date, info1) table2 ( Id, date, nvarchar(50)
I have 3 tables: table1:table1_col1, table1_col2,table1_col3 table2 : table1_col1, table2_col2,table2_col3 table3 : table1_col1, table3_col2,table3_col3

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.