tagged [join]

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...

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 ...

13 Aug at 19:43

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...

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...

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...

27 Jul at 18:20

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...

8 Feb at 05:21

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...

23 May at 12:10

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-...

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...

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...

7 Jun at 13:13

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...

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...

1 Sep at 19:27

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...

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 ...

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...

4 Mar at 13:56

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

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...

30 Aug at 11:54

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 ...

21 Jan at 01:16

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...

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...

31 Mar at 18:58

Retrieving data using LINQ

Retrieving data using LINQ I am stuck with this problem since few evenings. I have `SQLite` database in my application. I have created that SQLite DB from a file. The ERD diagram is shown below: ![ent...

29 Aug at 12:17

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...

2 Sep at 13:7

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...

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 ...

18 Dec at 12:8