Questions tagged [intersect]

The SQL intersect operator returns rows that are common between two tables without returning duplicate records.

643 questions
1
vote
2 answers

Query 2 MYSQL tables to display certain results?

I will try to be short. I got two tables: Users ID | Name 1 | Joe 2 | Jimmy Phone ID | Number | User 1 | 12345 | 1 2 | 56789 | 2 Now I want generate a query to display all phones, but instead of showing the user number I want show his…
Henrique
  • 21
  • 3
1
vote
1 answer

VBA loop through ActiveX CheckBoxes within range

I have a form where a macro will hide the relevant rows when called. It has multiple checkboxes within the range of rows. I know I can set the CheckBoxes to "Size and Move with Cells" but I do not want them to size with cells as the row needs to be…
Quimby
  • 11
  • 3
1
vote
1 answer

How to simulate a N-dimension INTERSECT with generic SQL

Here is an example of 2 extract from the same table: SELECT source_id FROM table_cust_string_value WHERE cust_string_id=2 AND VALUE LIKE '%TATA%'; SELECT source_id FROM table_cust_string_value WHERE cust_string_id=4 AND VALUE LIKE '%TUTU%'; They…
Maike
  • 148
  • 6
1
vote
1 answer

Using Linq intersect with sub values?

I found this post Match elements between 2 collections with Linq in c# which explained how you can use Intersect to find matching elements between two lists. Can you use this to match elements in two lists that are not of exactly the same, but have…
Anders
  • 12,556
  • 24
  • 104
  • 151
1
vote
2 answers

Error in using WITH clause and INTERSECT in SQLite

I have two SQL queries; First one is: with b as (select person_id from people where name='Ward Bond' and born=1903) select title_id from b natural join crew; Which is producing correct results and is OK. Another one is: with c as (select person_id…
Reza Namvar
  • 129
  • 11
1
vote
1 answer

intersecting elements after grouping by a variable

I have a data that looks as follow: toy.dat <- data.frame(group = c(rep("A_0", 3), rep("A_1", 2), rep("B_0", 3) , rep("B_1", 3))) toy.dat$letters <- c("A", 'B', "C", "A", "D", "C", "E", "F", "A", "B", "F") toy.dat…
say.ff
  • 373
  • 1
  • 7
  • 21
1
vote
1 answer

PSQL: Easy way to batch select queries

If you have table A with n columns, and a list of values with m columns where m is a subset of n, how do you query the table with one SQL statement, instead of multiple queries? Example: users table has 4 columns: id, name, ip, email Example Query: …
1
vote
4 answers

How can I keep data from one dataframe based on its appearance in a second dataframe?

I have 2 dataframes containing similar data. I know for a fact that data from dataframe 2 appears repeated throughout dataframe 1. I want to extract all the rows from dataframe 1 which have an ID matching one of those seen in dataframe 2. For…
Molly K
  • 23
  • 4
1
vote
1 answer

Find INTERSECT of two tables using DBT

I want to find common columns between 2 tables using DBT. But I am unable to find the right way to do it. can anyone help with that? Thanks in advance
amitesh shukla
  • 49
  • 1
  • 12
1
vote
1 answer

How to merge 2 dataframes with 4 columns each into a matrix with each cell returning the intersect

I have 2 datasets and I want to compare each columns between the 2 datasets and get their intersects. how do i go about this? I have an example below to better explain what i wish to be returned. I am working with Rstudio. dt1…
1
vote
2 answers

Select the rows having a specific set of characteristics

Apologies for the hand-wavy title, I honestly couldn't come up with a better description while keeping the text short. Here's the full problem. In a table with two columns, I'd like to select the one entry in the first column that has all the values…
Jir
  • 2,985
  • 8
  • 44
  • 66
1
vote
2 answers

Transact SQL ON EXISTS statement

I've got a Transact SQL problem which I don't understand. I have 2 tables tblMedewerker2 and tblMedewerker3. tblMedewerker2 has got the following values for employeenumber :129, 143,144,145,146,147,169. tblMedewerker3 has got the following values…
Billybob49
  • 11
  • 1
1
vote
4 answers

Scala How to Intersect Maps of types Map[String, Double] inside a List of: List[Map[String, Double]]

So I have a list of maps: List[Map[String, Double]]. An example of it would be: List(Map("A" -> 1.1, "B" -> 2.5, "E" -> 3.5, "C" -> 1.6, "D" -> 0.9), Map("A" -> 0.8, "C" -> 2.1, "D" -> 2.8), Map("C" -> 2.2, "D" -> 2.9, "A" -> 3.4),…
1
vote
2 answers

C# Intersect Extension - where do the "equal" elements come from?

I wrote a custom extension that returns the intersection between two collection and both the unique elements in a an b. public static void CompareTo( this IEnumerable sourceA, IEnumerable sourceB, IEqualityComparer
yBother
  • 648
  • 6
  • 25
1
vote
1 answer

Managing the intersect VBA function

I'm currently implementing some VBA code that allows a listbox to trigger on certain columns and then once filled in the cell gets filled with the selection. The initial solution has been adapted from Checkboxes for multiple values in a single cell…