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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:20:58+00:00 2026-06-12T22:20:58+00:00

I have a database where the tables are: Table1: Table1Id int Table2: Table2Id int

  • 0

I have a database where the tables are:

Table1:
Table1Id int

Table2:
Table2Id int
ForeignKeyToTable1 int

LookupTable:
Table2Id
Table3Id

Table3:
Table3Id int
Table3Field varchar

I want to:

select table1.* from table1
inner join table2 on table1.Table1Id = ForeignKeyToTable1 
inner join LookupTable on LookupTable.Table2Id = table2.Table2Id 
inner join Table3 on table3.Table3Id = LookupTable.Table3Id
where table3.Table3Field ='qwerty'

How can this be achieved in Linq?

  • 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-12T22:21:01+00:00Added an answer on June 12, 2026 at 10:21 pm
    var query = 
                from table1 in db.Table1
                join table2 in db.Table2 on new { Table1Id = table1.Table1Id } equals new { Table1Id = table2.ForeignKeyToTable1 }
                join lookuptable in db.LookupTable on table2.Table2Id equals lookuptable.Table2Id
                join table3 in db.Table3 on lookuptable.Table3Id equals table3.Table3Id
                where
                  table3.Table3Field == "qwerty"
                select new {
                  table1.Table1Id
                };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two tables in my database table1, table2. I have a join query
I have two tables( Table1 and Table2 ) in a SQL Server database and
I have three tables table1, table2, table3 with col1, col2 and identity ID column.
I have a mysql database with two tables: table1 (id, name, emailid) table2 (id,
I have the following tables in a legacy database: Table1 + Table1ID PK +
I have a database with two tables ( Table1 and Table2 ). They both
I have 2 tables in my database, for example: Table1: id (PK), data1 and
I have two database tables with the following structure: actions: action_id int(11) primary key
I have a database with three tables: user_table country_table city_table I want to write
I have table1 and table2 in a Mysql database. Each table has a field

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.