---
title: "How to Get results from multiple tables using LINQ"  
description: "How to Get results from multiple tables using LINQ"  
author: "Utpal Vishwas"  
published: 2023-09-05  
updated: 2023-09-06  
canonical: https://www.mindstick.com/forum/159851/how-to-get-results-from-multiple-tables-using-linq  
category: "linq"  
tags: ["database table", "asp.net core", ".net core"]  
reading_time: 2 minutes  

---

# How to Get results from multiple tables using LINQ

How to Get [results](https://yourviews.mindstick.com/story/4497/usage-of-baking-soda-magical-results) from [multiple tables](https://www.mindstick.com/forum/159848/how-to-get-multiple-tables-using-entity-framework-core) using [LINQ](https://www.mindstick.com/articles/12007/language-integrated-query-linq-queries)

## Replies

### Reply by Aryan Kumar

To retrieve results from [multiple](https://www.mindstick.com/blog/12797/iowa-is-expected-to-see-heavy-growth-in-multiple-sectors) [tables](https://www.mindstick.com/articles/336597/introduction-of-html-tables-for-web-development) using LINQ, you can use the `Join` operator. The `Join` operator takes two or more tables as input and returns a new table that contains the rows from all the tables that match the join condition.

The join operator has the following syntax:

```plaintext
from table1 in source
join table2 in otherSource on table1.column1 equals table2.column2
select new { column1, column2 }
```

where `source` is the name of the first table, `otherSource` is the name of his second table, `column1` is the name of the column in the first table that is used to join the tables, and `column2` is the name of the columns of the second table that is used to join the tables.

For example, the following code joins the `Customers` and `Orders` tables:

```plaintext
from customer in Customers
join order in Orders on customer.Id equals order.CustomerId
select new { customer.Name, order.OrderId }
```

This code returns a new table that containing the names of all the customers and the IDs of all orders.

You can also join three or more tables using the `Join` operator. For example, the following code joins the `Customers`, `Orders`, and `Products` tables:

```plaintext
from customer in Customers
join order in Orders on customer.Id equals order.CustomerId
join product in Products on order.ProductId equals product.Id
select new { customer.Name, order.OrderId, product.Name }
```

This code returns a new table containing the name of all customers, the IDs of all orders, and the names of all the products that they ordered.


---

Original Source: https://www.mindstick.com/forum/159851/how-to-get-results-from-multiple-tables-using-linq

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
