Questions tagged [intersect]

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

643 questions
6
votes
1 answer

Why is INTERSECT as slow as a nested JOIN?

I'm using MS SQL. I have a huge table with indices to make this query fast: select userid from IncrementalStatistics where IncrementalStatisticsTypeID = 5 and IncrementalStatistics.AssociatedPlaceID = 47828 and IncrementalStatistics.Created >…
John Shedletsky
  • 7,110
  • 12
  • 38
  • 63
6
votes
3 answers

Using LINQ to objects Intersect and Except on a specific property

When I have 2 List objects, then I can use Intersect and Except on them directly to get an output IEnumerable. That's simple enough, but what if I want the intersection/disjuction on something more complex? Example, trying to get a…
Diana
  • 61
  • 1
  • 2
6
votes
3 answers

How do I intersect two Maps by their keys in F#

I want to interesct two F# Maps, which have common keys, into a Map that has the common keys and a tuple of both values as it's value. i.e the signature is something like: Map -> Map -> Map Any ideas of an easy functional…
damageboy
  • 2,097
  • 19
  • 34
6
votes
3 answers

JAVA & Joda Time API: compare intervals, detect overlapping and generate new intervals

I am working on a project that confuses me really bad right now. Given is a List list that contains elements of the class TimeInterval, which looks like this: public class TimeInterval { private static final Instant CONSTANT = new…
Mosh Pit
  • 318
  • 5
  • 14
6
votes
1 answer

R intersecting strings

I have the following data as an example: basketball = c("MISS W. Johnson 18' Pullup Jump Shot", "MISS Barnes 12' Pullup Jump Shot", "MISS Carter 19' Pullup Jump Shot") How do I find the most common words or…
geodex
  • 1,219
  • 3
  • 13
  • 22
6
votes
2 answers

R intersect data.frame on multiple criteria

I am trying to populate a binary vector based on the intersection of two data.frames on multiple criteria. I have the code working but I feel that it is memory excessive just to get the binary vector. When I apply my code to my full data (40mm+…
Brad
  • 813
  • 1
  • 10
  • 20
6
votes
2 answers

List Intersect returning null

I have two List and I want to return the common FileItem between them. List outputList = new List(); outputList = list1.Intersect(list2).ToList(); However, I'm getting back an empty List. Both the lists contain…
Emlinie
  • 117
  • 1
  • 3
  • 10
6
votes
3 answers

Sql intersect conditional

I want to know if we can do an intersect conditional. theres is somes query, but the result is wrong (always empty). I write what it should result. DECLARE @CAN_USE_TABLE1 BIT DECLARE @CAN_USE_TABLE2 BIT DECLARE @CAN_USE_TABLE3 BIT DECLARE…
forX
  • 2,063
  • 2
  • 26
  • 47
5
votes
2 answers

MySQL INTERSECT via joins table?

So essentially I have two tables, containing URLS and TAGS, with a has-and-belongs-to-many relationship between the two via a joins tables TAGS_URLS. A simple query to find URL's by tags would be: SELECT urls.id FROM urls INNER JOIN tags_urls ON…
Steve C.
  • 73
  • 6
5
votes
2 answers

Intersection of Two Lists Objects in java 8

An intersection of Two Lists Objects in java 8. Can some tell me what am I doing wrong? List originalStudent = new ArrayList<>(); List newStudent = new ArrayList<>(); List intersectListStudent = new…
Myjay1516
  • 197
  • 2
  • 4
  • 12
5
votes
2 answers

Python API sentinelsat error in query intersect

I'm facing a problem when searching for an image that contains specific coordinates. I can't get the intersect function to work with the API. I'm getting this error message: sentinelsat.sentinel.SentinelAPIError: HTTP status 200 OK: Invalid query…
5
votes
2 answers

Perform non-pairwise all-to-all comparisons between two unordered character vectors --- The opposite of intersect --- all-to-all setdiff

EXAMPLE DATA v1 <- c("E82391", "X2329323", "C239923", "E1211", "N23932", "F93249232", "X93201", "X9023111", "O92311", "9000F", "K9232932", "L9232932", "X02311111") v2 <- c("L9232932", "C239923", "E1211", "E82391", "F93249232", "U82832") PROBLEM I…
paropunam
  • 488
  • 2
  • 11
5
votes
6 answers

jquery arrays intersect

I previously posted this question as jquery/javascript: arrays - jquery/javascript: arrays. But since I am a complete beginner I have formulated the question wrong and didn't understand the answers either.... :( After failing to implement the given…
tschardak
  • 63
  • 1
  • 1
  • 4
5
votes
2 answers

Intersection of two select

I have this table : +----+-----------+-------+ | id | client_id | is_in | +----+-----------+-------+ | 1 | 1 | 0 | +----+-----------+-------+ | 2 | 2 | 0 | +----+-----------+-------+ | 3 | 1 | 1 …
Gatoyu
  • 642
  • 1
  • 6
  • 22
5
votes
2 answers

Intersection of two lists using LINQ

I have a User called admin who has a list of Companys. I want to return a list of Users who have one or more of the same Companys. I am using Linq using this query but I'm not sure why it is not working. I don't really understand what the .Any()…
Minda Minda
  • 73
  • 1
  • 6
1 2
3
42 43