join Questions

4

Solved

It is possible to generate the following query using CI's query builder methods? SELECT name FROM table1 t1 JOIN (SELECT ID FROM table2 ORDER BY id LIMIT 5) t2 ON t2.id=t1.t2_id WHERE t1.id&...
Priestley asked 10/1, 2013 at 5:29

3

Solved

I have two tibbles with unique values, with unequal length like: df1 <- structure(list(col1 = c("A", "T", "C", "D", "X", "F")), class ...
Thermo asked 20/8 at 18:5

7

Solved

Here's a simplified example of what I'm talking about: Table: students exam_results _____________ ____________________________________ | id | name | | id | student_id | score | date | |----+------...
Romanticist asked 7/12, 2009 at 23:22

6

Solved

I'm trying to programmatically build a search query, and to do so, I'm joining a table. class User(db.Model): id = db.Column(db.Integer(), primary_key=True) class Tag(db.Model): id = db.Column(...
Riess asked 6/3, 2016 at 16:1

7

Solved

I have been stuck with computing efficiently the number of classmates for each student from a course-level database. Consider this data.frame, where each row represents a course that a student has ...
Lockyer asked 9/7 at 16:49

7

Solved

I would like to include null values in an Apache Spark join. Spark doesn't include rows with null by default. Here is the default Spark behavior. val numbersDf = Seq( ("123"), ("456"), (null),...
Locally asked 18/1, 2017 at 20:21

8

Solved

Is there an alternative to joins to increase performance? Edit (gbn): related to join-or-correlated-subquery-with-exists-clause-which-one-is-better Why didn't anyone mention about nested loop j...
Tiro asked 24/7, 2010 at 6:51

3

Solved

Trying to join 2 tables with an OR condition like this: FULL JOIN table1 ON (replace(split_part(table1.contract_award_number::text, ' '::text, 2), '-'::text, ''::text)) = table2.contract_award_id...
Burgess asked 21/11, 2017 at 5:21

7

Consider two dataframes, df1 and df2. df1 has columns id, a, b. df2 has columns id, a, c. I want to perform a left join such that the combined dataframe has columns id, a, b, c. combined <- d...
Fusiform asked 6/5, 2020 at 5:21

3

Solved

I'm wondering if anyone's come across a neat solution to this problem. I'm trying to select data from a couple of tables, having the records match up row by row. I'm basically after a full outer jo...
Tomasatomasina asked 6/6, 2012 at 15:3

2

Solved

I'm writing a complex MySQL query with multiple LEFT JOINs to combine data from several different tables. $public_query = "SELECT * FROM `wsat_ib` LEFT JOIN wp_usermeta ON wsat_ib.user_id = wp_u...
Resor asked 27/12, 2012 at 19:43

2

I have: two entities with undirectional M:M association. class ShareInfo { // ... /** * @ORM\ManyToMany(targetEntity="Item") * @ORM\JoinTable(name="share_info_items", * joinColumns={@ORM\Joi...
Patio asked 5/5, 2015 at 21:10

3

Before maptools and rgdal were deprecated, I used this code to import a shapefile, centroids csv and commuting count data, to create a flow map using the code below (I removed the ggplot code for l...
Doby asked 5/3 at 12:23

4

Solved

Is there a way to join tables that don't have associations defined using include in sequelize? This is not a duplicate of this. I am talking about tables that are not associated at all but having c...
Arnaud asked 10/11, 2017 at 5:4

10

I am using SQL2000 and I would like to join two table together based on their positions For example consider the following 2 tables: table1 ------- name ------- 'cat' 'dog' 'mouse' table2 -----...
Inweave asked 27/4, 2009 at 11:52

3

Solved

I have two data frames that I want to join using dplyr. One is a data frame containing first names. test_data <- data.frame(first_name = c("john", "bill", "madison", "abby", "zzz"), stringsAsF...
Reinhold asked 19/2, 2014 at 18:14

2

Solved

I am confused with the USING keyword which is used to join two tables in postgres. I first saw it in another SO post Compare two tables in postgres. I checked the manual for postgres 2.6. Joins Bet...
Bona asked 27/5, 2015 at 7:55

6

Solved

Please look at the following query: tbl_Contents Content_Id Content_Title Content_Text 10002 New case Study New case Study 10003 New case Study New case Study 10004 New case Study New case Study ...
Vendetta asked 31/3, 2014 at 18:43

7

Solved

In a MySQL JOIN, what is the difference between ON and USING()? As far as I can tell, USING() is just more convenient syntax, whereas ON allows a little more flexibility when the column names are n...
Recoil asked 6/7, 2012 at 16:16

8

Solved

Is it possible to do SQL inner joins kind of stuff in MongoDB? I know there is the $lookup attribute in an aggregation pipeline and it is equivalent to outer joins in SQL, but I want to do somethin...
Osteoblast asked 1/6, 2016 at 17:57

5

Solved

I'm trying to execute a join query for 4 tables on postgres. Table names: scenarios_scenario payments_invoice payments_payment payments_action (all those weird names are generated by django -))) ...
Meave asked 18/9, 2017 at 8:37

7

Solved

Please help me understand where to use a regular JOIN and where a JOIN FETCH. For example, if we have these two queries FROM Employee emp JOIN emp.department dep and FROM Employee emp JOIN FETCH e...
Rheo asked 2/7, 2013 at 16:50

2

Solved

Is it possible to run a query using ILIKE with the IN function? For example: SELECT store_names FROM stores WHERE states ILIKE IN (SELECT location FROM locations WHERE stateID = 1) I want to r...
Ten asked 10/10, 2012 at 23:13

2

What’s a performant way to do fuzzy joins in PySpark? I am looking for the community's views on a scalable approach to joining large Spark DataFrames on a nearest key condition. Allow me to illust...
Jed asked 24/9, 2019 at 9:30

2

Solved

i want to get user's images at limit 2 from Follow model. Models const Follow = connector.define('Follow', { no: { type: Sequelize.INTEGER, primaryKey: true, autoIncrement: true }, ...
Eo asked 7/11, 2018 at 8:45

© 2022 - 2024 — McMap. All rights reserved.