The SQL intersect operator returns rows that are common between two tables without returning duplicate records.
Questions tagged [intersect]
643 questions
2
votes
5 answers
How to intersect() and include duplicates?
I have the following character fields I am trying to intersect. These should be equal.
> char.y[[892]]
[1] "E" "d" "w" "a" "r" "d" "s" " " "L" "i" "f" "e" "s" "c" "i" "e" "n" "c" "e" "s"
> char.x[[892]]
[1] "E" "d" "w" "a" "r" "d" "s" " " "L" "i"…

Alex Bădoi
- 830
- 2
- 9
- 24
2
votes
2 answers
Why does unique command act like intersect command?
I have checked the questions but I couldn't find any explanation.
So I have two vectors and I only want to choose the different elements that one has and the other hasn't.
I defined to vectors hypothetically…

DSA
- 655
- 5
- 13
2
votes
2 answers
Intersection of row names in dataframe (subset the data)?
Since intersect doesn't work with dataframes, I'm trying to use subset to create a subset of dfA with only data for which dfA's row names match dfB's row names. I should end up with 3000 rows because dfA has 5000 rows and dfB has 3000, and all of…

user8121557
- 149
- 2
- 9
2
votes
1 answer
tsql intesect between 2 datetime recordsets
I have an appointments table with appointments for a number of 'resources'
what i need to do is query that and return (for a particular resource) all free appointment slots across a date range.
i had thought the best way to approach this would be to…

nat
- 2,185
- 5
- 32
- 64
2
votes
1 answer
dplyr mutate intersect not working
I have a sample data frame like this
I am trying to find the intersection between the 2 columns coauthors and nacoauthors using the following code
interscout =
sample_test %>%
mutate( commonauth = intersect( coauthors, nacoauthors) )
and I…

Dinesh
- 2,194
- 3
- 30
- 52
2
votes
0 answers
Why is an intersection of two shapefiles done in R not the same as an intersection done in ArcGIS?
First I installed packages and such and set the working directory (example given)…
library(rgdal)
library(rgeos)
library(raster)
library(maptools)
setwd("V:/Water/GIS/"Shapefiles Intersected in R")
Then I read in shapefiles from computer folder -…

08625
- 21
- 3
2
votes
2 answers
Select with own array. PostgreSQL 9.5
I have the following schema:
create table reports (id bigserial primary key);
create table scens (id bigserial primary key,report_id bigint references reports(id), path_id bigint);
create table runs (id bigserial primary key,scen_id bigint…

user565447
- 969
- 3
- 14
- 29
2
votes
1 answer
PostGIS Intersection multiple geometry
I have a postgis polygon table (zipcode1) and two point table (pm253, blockpop). I would like to intersect the polygon table against the two point table and count how many point I have for each point table, sum up some other attributes to calculate…

Giovanni Zambotti
- 79
- 1
- 9
2
votes
2 answers
Find duplicates of exactly two items from Array1 in Array2 using LINQ C#
Say I've got an
Array1 [1,2,3]
and a List of arrays Array2 [3,2,4] Array3 [2,16,5]
I need to return only those elements of the List which contain exactly two ints from Array1. In this case, Array2 since integers 2 and 3 intersect;
Thanks

Nikita Rostov
- 29
- 1
- 4
2
votes
1 answer
Merge linear intervals
I have a data.frame which consists of linear intervals for each id:
df <- data.frame(id = c(rep("a",3),rep("b",4),rep("d",4)),
start = c(3,4,10,5,6,9,12,8,12,15,27),
end = c(7,8,12,8,9,13,13,10,15,26,30))
I'm…

user1701545
- 5,706
- 14
- 49
- 80
2
votes
3 answers
Intersect between 2 collections in C#
I have:
List l1 = listQ1.ToList();
List l2 = listQ2.ToList();
And I need to intersect it comparing ids. Something like that:
l1.Intersect(l2, l1[].id_infraestructura ==…

Argon
- 139
- 2
- 12
2
votes
1 answer
intersect of two lists results in an empty list
I have two lists
List usersWithNPIRCodingPermission // It has count 159
List usersWithRaiseReq // It has count 219
When doing intersect on these (there are 55 records but my below line getting empty list)
List users…

Sak SK
- 31
- 5
2
votes
1 answer
How do I check if a Rectangle overlaps the area between three Points? (C# and XNA)
I am making a game in C# and XNA and I am using three Points to represent the hitbox of an enemy object. A Rectangle variable is used to represent the player's hitbox. I am using three Points for the enemy rather than a rectangle as the enemy is…

Ben
- 1,299
- 3
- 17
- 37
2
votes
1 answer
Perform a Sql Server Spatial Intersection against a table full of spatial features?
I have a table in sql 2015 that has a geometry column and about 10,000 records. I want to test if a new record i am thinking about adding overlaps any of the existing records.
I know that i can compare two features with STIntersects like…

VBAHole
- 1,508
- 2
- 24
- 38
2
votes
2 answers
Excel VBA Intersect
I found this code online and apparently it works for other people but not me? I don't know where it's wrong. I made a simple example and have my Range1 and Range 2 to be certain cells in excel,
Also, I would like to know if there is a way to return…

Ogre Magi
- 1,445
- 3
- 13
- 14