tagged [join]
Join one row to multiple rows in another table
Join one row to multiple rows in another table I have a table to entities (lets call them people) and properties (one person can have an arbitrary number of properties). Ex: ## People ## Properties ``...
- Modified
- 23 May at 19:11
How to execute my SQL query in CodeIgniter
How to execute my SQL query in CodeIgniter I have a problem with my query and now my problem is how can I execute my query. I got my syntax format from here [http://www.x-developer.com/php-scripts/sq...
- Modified
- 8 May at 08:6
MySQL LEFT JOIN Multiple Conditions
MySQL LEFT JOIN Multiple Conditions I have two tables: A and B linked by "group_id". 2 variables I'm using: `$keyword, $_SESSION['user_id']` group_id keyword id group_id user_id I want to be able to s...
Combine multiple results in a subquery into a single comma-separated value
Combine multiple results in a subquery into a single comma-separated value I've got two tables: The relationship is one row of `TableA` - many of `TableB`. Now, I want to see a result like this: ``` I...
- Modified
- 15 Mar at 08:11
How to perform Join between multiple tables in LINQ lambda
How to perform Join between multiple tables in LINQ lambda I am trying to perform a in LINQ. I have the following classes: And I use the following code (where `product`, `category` and `productcategor...
- Modified
- 15 Mar at 13:0
Inner Join with derived table using sub query
Inner Join with derived table using sub query Environment: I created a derived table using sub query and joined with main table. I just like to know if subquery is executed only once or will it be exe...
- Modified
- 21 Oct at 12:16
SQL Update from One Table to Another Based on a ID Match
SQL Update from One Table to Another Based on a ID Match I have a database with `account numbers` and `card numbers`. I match these to a file to `update` any card numbers to the account number so that...
- Modified
- 23 May at 16:50
LINQ to SQL: Multiple joins ON multiple Columns. Is this possible?
LINQ to SQL: Multiple joins ON multiple Columns. Is this possible? A table named `TABLE_1` with the following columns: - `ID`- `ColumnA`- `ColumnB`- `ColumnC` I have SQL query where `TABLE_1` joins on...
- Modified
- 15 Mar at 05:7
How do you left join in Linq if there is more than one field in the join?
How do you left join in Linq if there is more than one field in the join? I asked a question earlier about [why left joins in Linq can't use defined relationships](https://stackoverflow.com/questions/...
- Modified
- 23 May at 12:1
How can I join multiple SQL tables using the IDs?
How can I join multiple SQL tables using the IDs? I have 4 different tables that I want to join. The tables are structured with columns as follows: Starting with Table A, I understand how to JOIN tabl...
Is there some sort of syntax error with this LINQ JOIN?
Is there some sort of syntax error with this LINQ JOIN? I've looked at [various questions](https://stackoverflow.com/questions/3217669/how-to-do-a-join-in-linq-to-sql-with-method-syntax) on SO and [ot...
- Modified
- 23 May at 12:25
LINQ join two DataTables
LINQ join two DataTables Hi I have a problem joining two DataTables using LINQ. Tables have columns like this: I used linq to join like this: ``` DataTable dtResult = new DataTable(); dtResult.Columns...
using where and inner join in mysql
using where and inner join in mysql I have three tables. Here the table locations contains al
- Modified
- 8 Sep at 07:33
How do I just LINQ Join() to link two IQueryables?
How do I just LINQ Join() to link two IQueryables? I have two IQueryables: I already have an IQueryable for Ingredient: How can I add a join to his so it filters by `AvailableIngredient` (i.e. an Inne...
- Modified
- 8 Oct at 10:57
Can't get c# linq query to compile with joins
Can't get c# linq query to compile with joins Below is a cut down example of some c# code I can't get to compile while doing some linq joins. Does anyone know why this doesn't compile? The error is > ...
- Modified
- 30 Mar at 15:34
LINQ Join with Multiple Conditions in On Clause
LINQ Join with Multiple Conditions in On Clause I'm trying to implement a query in LINQ that uses a left outer join with multiple conditions in the ON clause. I'll use the example of the following two...
Join between in memory collection and EntityFramework
Join between in memory collection and EntityFramework Is there any mechanism for doing a JOIN between an in-memory collection and entity framework while preserving the order. What I am trying is which...
- Modified
- 26 Apr at 23:5
ServiceStack Ormlite - Joins on child classes
ServiceStack Ormlite - Joins on child classes I'm using the latest ServiceStack Ormlite (v4.0.23), which provides new join support for joining on multiple columns. My entities all inherit from a BaseE...
- Modified
- 26 Jun at 12:55
The type of one of the expressions in the join clause is incorrect in Entity Framework
The type of one of the expressions in the join clause is incorrect in Entity Framework While trying to execute this query: ``` var query = from dpr in ctx.DPR_MM join q in ctx.QOT on dpr.DPR_QOT...
- Modified
- 15 Dec at 22:49
What's the best way to join on the same table twice?
What's the best way to join on the same table twice? This is a little complicated, but I have 2 tables. Let's say the structure is something like this: The tables can be joined based on Table1.PhoneNu...
How to do join on multiple criteria, returning all combinations of both criteria?
How to do join on multiple criteria, returning all combinations of both criteria? I am willing to bet that this is a really simple answer as I am a noob to SQL. Given: - - There can be anywhere from 1...
- Modified
- 2 Nov at 00:46
Pandas Merging 101
Pandas Merging 101 - `INNER``LEFT``RIGHT``FULL``OUTER``JOIN`- - - - - - `merge``join``concat``update` ... and more. I've seen these recurring questions asking about various facets of the pandas merge ...
- Modified
- 31 Jul at 17:38
LINQ to SQL - Left Outer Join with multiple join conditions
LINQ to SQL - Left Outer Join with multiple join conditions I have the following SQL, which I am trying to translate to LINQ: I have seen the typical implementation of the left outer join (ie. `into x...
- Modified
- 17 Sep at 15:10
MySQL: How do I join same table multiple times?
MySQL: How do I join same table multiple times? I have two tables `ticket` and `attr`. Table `ticket` has `ticked_id` field and several other fields. Table `attr` has 3 fields: `attr_type` is a fixed ...
JPA Criteria API - How to add JOIN clause (as general sentence as possible)
JPA Criteria API - How to add JOIN clause (as general sentence as possible) I am trying to construct queries dynamically, and my next target is add JOIN clauses (I don't know how can I use the API). B...
- Modified
- 9 Oct at 16:46
MySQL complex query not yielding proper results
MySQL complex query not yielding proper results I have two table: Vehicles(Id, VIN) and Images(Id, VehicleId, Name, Default). I need to select the vehicles VIN and its default picture to display in a ...
Why is this Cross Join so Slow in Linq?
Why is this Cross Join so Slow in Linq? I wrote this piece of Linq to handle doing a CROSS Join just like a database would between multiple lists. But for some reason it's extremely slow when any of t...
- Modified
- 14 Mar at 13:13
Entity Framework include with left join is this possible?
Entity Framework include with left join is this possible? I have the following tables 1. ClassRoom (ClassID,ClassName) 2. StudentClass (StudentID,ClassID) 3. Student (StudentID,StudentName,Etc..) 4. S...
- Modified
- 27 Aug at 20:40
SQL Four Tables One Recordset
SQL Four Tables One Recordset What am I missing? I need to return all records that match the Last_Name Query whether they do or do not have a Customer Number in the Field_Table. I am calling the Clien...
LINQ Inner-Join vs Left-Join
LINQ Inner-Join vs Left-Join Using extension syntax I'm trying to create a left-join using LINQ on two lists that I have. The following is from the Microsoft help but I've modified it to show that the...
How to do joins in LINQ on multiple fields in single join
How to do joins in LINQ on multiple fields in single join I need to do a LINQ2DataSet query that does a join on more than one field (as I have yet found a suitable solution (I can add the extra constr...
Nice, clean cross join in Linq using only extension methods
Nice, clean cross join in Linq using only extension methods > [Nested “from” LINQ query expressed with extension methods](https://stackoverflow.com/questions/9115675/nested-from-linq-query-expressed-...
- Modified
- 23 May at 12:2
How to use join with multiple conditions in linq-to-Nhibernate
How to use join with multiple conditions in linq-to-Nhibernate I have two classes (Request & RequestDetail). I need to a `Linq To NHibernate`query between two classes by join. ``` var q = SessionInsta...
- Modified
- 15 Nov at 09:39
how do you search Right/Left joins?
how do you search Right/Left joins? I am having a problem searching multiple tables ,i have 2 tables tblcourse -courseid -name -status tblenroll -courseid(holds courseid from tblcourse) -studentid let...
SQL Left Join first match only
SQL Left Join first match only I have a query against a large number of big tables (rows and columns) with a number of joins, however one of tables has some duplicate rows of data causing issues for m...
- Modified
- 12 Oct at 02:2
query specified join fetching, but the owner of the fetched association was not present in the select list
query specified join fetching, but the owner of the fetched association was not present in the select list I'm selecting two id columns but get error specified: ``` org.hibernate.QueryException: **que...
Combine two pandas Data Frames (join on a common column)
Combine two pandas Data Frames (join on a common column) I have 2 dataframes: restaurant_ids_dataframe ``` Data columns (total 13 columns): business_id 4503 non-null values categories 4503 non-nu...
Include with FromSqlRaw and stored procedure in EF Core 3.1
Include with FromSqlRaw and stored procedure in EF Core 3.1 So here's the deal - I am currently using EF Core 3.1 and let's say I have an entity: When I access the `DbSet Entities` normal way, I inclu...
- Modified
- 17 Dec at 20:18
lambda expression join multiple tables with select and where clause
lambda expression join multiple tables with select and where clause I have three table many to many relationship I have joined the three table and select the value I want but now I need to select one ...
- Modified
- 17 Nov at 06:29
Create combined DataTable from two DataTables joined with LINQ. C#
Create combined DataTable from two DataTables joined with LINQ. C# I have the following code that fills `dataTable1` and `dataTable2` with two simple SQL queries, `dataTableSqlJoined` is filled from t...
How to LeftJoin to the same table twice using ServiceStack OrmLite?
How to LeftJoin to the same table twice using ServiceStack OrmLite? I have table structures that look like below: I want to use OrmLite to generate SQL simil
- Modified
- 27 Jan at 14:4
SQL select join: is it possible to prefix all columns as 'prefix.*'?
SQL select join: is it possible to prefix all columns as 'prefix.*'? I'm wondering if this is possible in SQL. Say you have two tables A and B, and you do a select on table A and join on table B: If t...
JPA eager fetch does not join
JPA eager fetch does not join What exactly does JPA's fetch strategy control? I can't detect any difference between eager and lazy. In both cases JPA/Hibernate does not automatically join many-to-one ...
SQL Server: Multiple table joins with a WHERE clause
SQL Server: Multiple table joins with a WHERE clause I'm using SQL Server and I'm having a difficult time trying to get the results from a `SELECT` query that I want. I've tried joining in different o...
- Modified
- 5 Nov at 22:9
Left Join without duplicate rows from left table
Left Join without duplicate rows from left table Please look at the following query: ``` Content_Id Content_Title Content_Text 10002 New case Study New case Study 10003 New case Study New case St...
- Modified
- 31 Mar at 18:58
How to Left Outer Join two DataTables in c#?
How to Left Outer Join two DataTables in c#? How can I Left Outer Join two data tables with the following tables and conditions while keeping all columns from both tables? dtblLeft: dtblRight: ``` col...
Getting inappropriate output with left join
Getting inappropriate output with left join I am trying to get list of variants and for each of this variants get all `subvariants list` irrespective of where subvariants fall for particular `Test say...
- Modified
- 1 Aug at 18:57
Does "where" position in LINQ query matter when joining in-memory?
Does "where" position in LINQ query matter when joining in-memory? Say we are executing a LINQ query that joins two in-memory lists (so no DbSets or SQL-query generation involved) and this query also ...
- Modified
- 18 Dec at 12:8