tagged [join]
Merge two rows in SQL
Merge two rows in SQL Assuming I have a table containing the following information: is there a way I can perform a select on the table to get the following Thanks Edit: Fix field2 name for clarity
MySQL how to join tables on two fields
MySQL how to join tables on two fields I have two tables with `date` and `id` fields. I want to join on both fields. I tried that works, but it is very slow. is there a better way to do this?
SQL Server - INNER JOIN WITH DISTINCT
SQL Server - INNER JOIN WITH DISTINCT I am having a hard time doing the following: I want to do a join on ValTbl but only for distinct values.
- Modified
- 19 Dec at 20:42
How to concatenate two collections by index in LINQ
How to concatenate two collections by index in LINQ What could be a LINQ equivalent to the following code? ``` string[] values = { "1", "hello", "true" }; Type[] types = { typeof(int), typeof(string)...
- Modified
- 24 Jan at 10:27
How can I join an array of strings but first remove the elements of the array that are empty?
How can I join an array of strings but first remove the elements of the array that are empty? I am using the following: Parts has 7 entries but two of them are the empty string "". How can I first re...
How to select all rows which have same value in some column
How to select all rows which have same value in some column I am new to sql so please be kind. Assume i must display all the employee_ids which have the same phone number(Both columns are in the same ...
- Modified
- 16 Sep at 18:16
Linq Sub-Select
Linq Sub-Select How do I write a sub-select in LINQ. If I have a list of customers and a list of orders I want all the customers that have no orders. This is my pseudo code attempt:
- Modified
- 9 Feb at 11:50
How to inner join tables from different Data Context?
How to inner join tables from different Data Context? I have two tables from two different Data Contexts. Although both tables are from the same database, two separate datacontexts exist. Error messa...
- Modified
- 4 Mar at 05:33
C# Outer Apply in LINQ
C# Outer Apply in LINQ How can I achieve Outer Apply in LINQ? I'm having a bit of a problem. Here's the SQL Query I'm using.
- Modified
- 10 Jun at 12:39
How can I delete using INNER JOIN with SQL Server?
How can I delete using INNER JOIN with SQL Server? I want to using `INNER JOIN` in . But I get this error: > Msg 156, Level 15, State 1, Line 15 syntax near the 'INNER'. My code:
- Modified
- 2 Oct at 07:17
What is the syntax for an inner join in LINQ to SQL?
What is the syntax for an inner join in LINQ to SQL? I'm writing a LINQ to SQL statement, and I'm after the standard syntax for a normal inner join with an `ON` clause in C#. How do you represent the ...
- Modified
- 21 Aug at 10:31
Join vs. sub-query
Join vs. sub-query I am an old-school MySQL user and have always preferred `JOIN` over sub-query. But nowadays everyone uses sub-query, and I hate it; I don't know why. I lack the theoretical knowled...
SQL Inner join 2 tables with multiple column conditions and update
SQL Inner join 2 tables with multiple column conditions and update I am using this script, trying to join 2 tables with 3 conditions and update T1: but I encounter: `Incorrect syntax near the keyword ...
- Modified
- 3 May at 15:30
How to join multiple collections with $lookup in mongodb
How to join multiple collections with $lookup in mongodb I want to join more than two collections in MongoDB using the aggregate `$lookup`. Is it possible to join? Give me some examples. Here I have t...
- Modified
- 21 Feb at 20:53
What is the difference between JOIN and JOIN FETCH when using JPA and Hibernate
What is the difference between JOIN and JOIN FETCH when using JPA and Hibernate Please help me understand where to use a regular JOIN and where a JOIN FETCH. For example, if we have these two queries ...
Update statement with inner join on Oracle
Update statement with inner join on Oracle I have a query which works fine in MySQL, but when I run it on Oracle I get the following error: > SQL Error: ORA-00933: SQL command not properly ended 0093...
- Modified
- 20 Nov at 09:39
Joins are for lazy people?
Joins are for lazy people? I recently had a discussion with another developer who claimed to me that JOINs (SQL) are useless. This is technically true but he added that using joins is less efficient t...
SQL DELETE with INNER JOIN
SQL DELETE with INNER JOIN There are 2 tables, `spawnlist` and `npc`, and I need to delete data from `spawnlsit`. `npc_templateid = n.idTemplate` is the only thing that "connect" the tables. I have tr...
- Modified
- 18 Aug at 09:39
cartesian product in pandas
cartesian product in pandas I have two pandas dataframes: What is the best practice to get their cartesian product (of course without writing it explicitly like me)?
- Modified
- 12 Feb at 02:19
Linq: What is the difference between == and equals in a join?
Linq: What is the difference between == and equals in a join? I always wondered why there's an `equals` keyword in linq joins rather than using the == operator. Instead of ``` Property deadline = (fro...
MySQL Multiple Joins in one query?
MySQL Multiple Joins in one query? I have the following query: So I am using an `INNER JOIN` and grabbing the `image_id`. So now, I want to take that image_id and turn it into `images.filename` f
Using left join and inner join in the same query
Using left join and inner join in the same query Below is my query using a left join that works as expected. What I want to do is add another table filter this query ever further but having trouble do...
- Modified
- 13 Mar at 15:27
How do you perform a left outer join using linq extension methods
How do you perform a left outer join using linq extension methods Assuming I have a left outer join as such: How would I express the same task using extension methods? E.g. ``` Foo.GroupJoin(Bar, f =>...
SQL left join vs multiple tables on FROM line?
SQL left join vs multiple tables on FROM line? Most SQL dialects accept both the following queries: Now obviously when you need an outer join, the second syntax is required. But when doing an inner jo...