Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [join]

A SQL JOIN clause combines records from two or more tables in a relational database.

4
votes
0answers
18 views

Merging client names into orders using RxJS

I have an API which I can't modify. I have to use data as it is. I want to join data from two separate requests where the second request is based on data from the first one. I have a working ...
1
vote
1answer
27 views

Query to generate payroll based on attendance for a month

I have written a query to generate payroll based on attendance for a month, for about 4000 employees. It takes quite a long time to execute. Basically, what I am doing is to joining two different ...
3
votes
2answers
118 views

VBA code to import data, doing lookups to detect duplicates

I have an import macro, which creates ID by concatenating cells, then I compare using VLOOKUP with another sheet if any duplicate found. It's running very slowly, so I want to know better ways to ...
1
vote
1answer
65 views

Merging records from one spreadsheet into another

I have created the code below that compare two spreadsheets . It initially compares the range of value from sheet1 ("Status") to sheet2 ("Interface") . Whenever a range matches with the ranges present ...
1
vote
1answer
36 views

Listing people with their phone numbers (if any)

I have the following tables in my database: ...
1
vote
1answer
45 views

Simple join between 2 tables with unusual structure

I have two tables as below ACCOUNTS: ...
2
votes
1answer
38 views

Conditional joining Pandas dataframes

I'm looking for an optimum way to join two Dataframes where the same record exists in both. Examples would be: ...
3
votes
0answers
72 views

Sequential master update

I'm creating a version of the classic sequential master file update in java. This is used when you sort two files by the same key for updating one file with the other. In this case, I'm pulling in all ...
1
vote
0answers
23 views

SQL self-join to label nodes on binary search tree

Would like feedback on my SQL (1) efficiency and (2) readability, and if the conditions I featured in my CASE statement could be transferred to a join, etc. Here'...
3
votes
1answer
81 views

Project management query for various organizational units

I use the code below to calculate the required information from other tables. I used joins to display names instead of IDs and to get required sums from other tables. I used ...
2
votes
1answer
52 views

Joining tables by skipping the intermediate parent table [closed]

We've tables adm_app, quals_data to which personal_data is a parent table. We are retrieving ...
2
votes
1answer
45 views

Comparing data in SQL using foreign keys

The following is given: ...
0
votes
1answer
169 views

T-SQL query outer apply with nested subqueries

I have the following 3 tables, and I don't have the option to modify them. [Logs] table with [log_type], ...
3
votes
1answer
40 views

Inner Join only if satisfies If condition

I'm looking for code review, and optimizations. I have two tables ItemCategory and ShopItemCategory ItemCategory ...
3
votes
4answers
2k views

Java8: Stream filter, map and joining with an alternative result if the stream is empty

Given a list of integers, I would like to: filter odds numbers produce a list inside brackets: [n1, n2, n3] if the list is empty it should be a dash ...
3
votes
1answer
651 views

Mapping key value pairs between two JavaScript objects

I have two JavaScript objects: ...
1
vote
1answer
43 views

Listing blog posts, each of which may belong to multiple categories

I have 3 tables like this: ...
3
votes
1answer
1k views

Joining WorkTypes to WorkGroups via Channels and Users to check authorization

I need to select some "work types" from a channel. These "channels" are in "work groups" and both channels and work groups need to have permissions to view them (tables are ChannelUsers and ...
1
vote
2answers
75 views

SQL-style join on arrays using ECMA6

I have a code snippet which performs an SQL-style join on objects in two arrays based on a specific field (in the code below, .id). ...
7
votes
3answers
219 views

Linking two databases based on street addresses

For my work, I wrote a python script to link 2 files. Since I am an autodidact and since no one of my colleagues writes code, I ask the question here. My code takes an unbelievable time to run. Is it ...
0
votes
1answer
100 views

MySQL query to select messages related to a user

Could someone please check my query and the table structures and let me know if there is any way to improve it. I would like some tips for my own personal development Query in PHP: ...
7
votes
1answer
73 views

Joining a product-application-customer relationship using Java 8 Streams

I have three classes: product, customer and application. The schema of these classes are as follows: ...
1
vote
1answer
2k views

Selecting employees in certain departments using LINQ

I am trying to select the DepartmentName from Employee Table based on where condition. Is any way to simplify the code? ...
4
votes
1answer
52 views

Counting penalties for each player by joining tables, where some of the data is null

I have a table full of player names: I also have a table full of player penalties: I have to list all of the players names, player numbers, and the number of penalties that they've incurred. To do ...
1
vote
1answer
56 views

Select sum from latest values in table

...
4
votes
2answers
138 views

Loading objects for users, roles, and groups from a query with LEFT OUTER JOINs

I have this function that returns me a list of users with their roles and groups. As you can see, this is how I fetch and create list of objects. I'm wondering whether this is a good approach and what ...
1
vote
0answers
166 views

Join via navigation properties with collection

There are some related collection objects in my table and I'm trying to get list with joining this tables. But this code is seems bad: Entities that shortened: User: ...
2
votes
0answers
37 views

Counting items that have a matching attribute

Here is my code which is going to through multiple for loops to get the matching product attribute. I have single product with attributes trying to find out the ...
7
votes
4answers
446 views

Using LINQ to group social networking links for each user

I have a model named User. Each user can have some social links. Now I want to get all users with their social link as a single row in the result. Here are my ...
3
votes
1answer
48 views

Acquiring earnings information

The first part of the query grabs Policy's Premiums, Effective and ...
4
votes
2answers
108 views

Matching maximal nodes with velocities

I have written a code which works very good for small data-files (see below). The data file 'WSPL.dat' which I want to evaluate has a size of 2.6 GB and the data file 'VELOC.dat' has a size of 4.3 GB....
3
votes
1answer
80 views

Gather information about computers from multiple CSV files

I created a script to import several CSV files from various sources and one CSV file with a list of systems in it. the script searches each CSV file to see if the system exist in the file and if it ...
2
votes
1answer
715 views

Cross context joins in .NET

This is how I made a cross context join. What do you think? How would you do this better? ...
1
vote
1answer
53 views

Rails query for all questions in tournaments that a user participates in

I'm new to rails and this is the situation I'm in: I have a User model that has many tournaments, a Tournament has many users ...
6
votes
1answer
3k views

Python search for array in large text file

I asked similar question at: https://stackoverflow.com/questions/38410982/superfast-regexmatch-in-large-text-file ...
3
votes
1answer
61 views

Filling in gym membership prices by joining PANDAS dataframes

I have two dataframes, df which contains a list of members in addition to the type of contract that they purchased on a given date, ...
3
votes
1answer
63 views

Get title from database based on member country

I asked this question before. However, I realized that I had to edit some of my code after I got good answers. Therefore, I'm asking a new question here. I have the following database: Each member ...
0
votes
1answer
78 views

Load title from database based on member country

As tim suggested, some changes to the database was necessary. I have posed an improved version of this question at Get title from database based on member country. I have the following database: ...
8
votes
2answers
18k views

Extracting values from dictionaries where the keys match

I have two Dictionaries with around 65,000 KeyValuePairs each. I used foreach and if-else statements to compare them and get values, but it goes very slow. How could I optimize my code and gain more ...
1
vote
1answer
39 views

Mapping discussion entries from an SQL-View to objects

In my ASP.NET MVC application, I am loading Discussion Entry records along with User info (who posted the entry), Badges (assigned to the entry), Reactions (made to the entry like Facebook-style ...
4
votes
1answer
26 views

SQL report of subscribers and their associated revenue

A user can have many subscriptions, and a subscription belongs to one plan. The plans table tells us a subscription's cost. Is the query below the correct one for ...
4
votes
1answer
1k views

Joining huge CSV files and splitting the result into batches

I've got ~20GB of data about the same subject, concatenated from small files of 16kB, each produced by different measurement equipment. They share some headers (on the example: B, D & E) and they ...
3
votes
0answers
34 views

Updating ActiveRecord with text from a joined table

I have an Active Record update with the following data model: TvMenuProfile has one rich_text_special ...
30
votes
6answers
5k views

Counting rows in a CSV file that correspond to a database row, each with a million records

I have two DataTables: dt: is populated from a CSV file with over 1.7 million rows dataStructure.Tables["AccountData"]: is ...
2
votes
1answer
31 views

Collating client ratings

The code is fetching records from a table called CSAT_SUMMARY_REPORTS[driver table] but due to the filters conditions applied which needs to be checked in another ...
6
votes
1answer
130 views

Report for a restaurant showing hourly sales information for a given timespan

I have been tasked with creating a report for a high-volume restaurant that shows hourly sales information for a given timespan. When generating this report for a single day, it's very quick, but when ...
4
votes
1answer
39 views

Fetching all the project's items for a specific project id

In the following query, I am fetching all the projects items with specific project id. At the same time, I am using a join in Select to fetch the delivered quantity of items of this project only. The ...
8
votes
2answers
92 views

Iterate list to map entries in Python

I have two files, namely: File1: CL1 AA XX YY ZZ SS \n CL2 3_b AA File2: AA string1 AA string2 3_b string3 My ...
3
votes
1answer
92 views

Scanning multiple huge files in Python (follow-up)

I'm trying to implement an algorithm able to search for multiple keys through ten huge files in Python (16 million of rows each one). I've got a sorted file with 62 million of keys, and I'm trying to ...
3
votes
2answers
801 views

Selecting product variants that satisfy all option criteria

My current query: ...