The SQL intersect operator returns rows that are common between two tables without returning duplicate records.
Questions tagged [intersect]
643 questions
2
votes
1 answer
Is the order of an except and intersect operation always ignorable?
For me it seems any operation like
var list = new List();
// list.Add some elements...
list.Except(anotherList).Intersect(yetAnotherList)
is this always the same like:
list.Intersect(yetAnotherList).Except(anotherList)
I am not 100%…

Daniel Bişar
- 2,663
- 7
- 32
- 54
2
votes
1 answer
IEqualityComparer to use Except, Intersect
I'm attempting to implement IEqualityComparer so I can compare custom objects for equality and differences.
Scenario: I have 10 batches of record sets that were imported at different times. I need to look at the most recent record set, and compare…

mrb398
- 1,277
- 4
- 24
- 32
2
votes
2 answers
Subtracting Delphi Time Ranges from a Date Range, Calculate Remaining Time
I'm looking for an algorithm that will help calculate a workday working time length. It would have an input date range and then allow subtracting partially or completely intersecting time range slices from that date range and the result would be…

Anagoge
- 933
- 1
- 14
- 23
2
votes
3 answers
mySQL experts - need help with 'intersect'
I know that mySQL 5.x does not support INTERSECT, but that seems to be what I need.
Table A: Products (p_id)
Table B: Prod_cats (cat_id) - category info (name, description, etc)
Table C: prod_2cats (p_id, cat_id) - many to many
prod_2cats holds the…

MTCreations
- 23
- 3
2
votes
1 answer
How to perform an INTERSECT query in Access SQL
I have this Python snippet for querying SQLite tables 'note', 'tag', and the many-to-many join table 'fkeys'. Very procedural I guess, but it works. Now I want to do a similar thing in Access but Jet SQL does not support INTERSECT.
I have been…

klausnrooster
- 520
- 3
- 13
2
votes
2 answers
SQL query to get average per group in two tables
I have two tables: students and results.
For students, the fields are student_id, name, grade
For results, the fields are student_id, score
grade is like pre-school, one, two, three.... Like in a school.
As you see, student_id is in both tables.
I…

Caraway Borlu
- 23
- 1
- 4
2
votes
0 answers
spritekit nodeAtPoint intersection
I am trying to detect the coordinates where two sprites (shipLaser and baddie) intersect and then make a new sprite (speedPowerUp) in that position. Below is what I have attempted to do with nodeAtPoint but it is just running and then crashing when…

stickynugz
- 41
- 7
2
votes
2 answers
Compare Keys in Two Dictionaries
I'm trying to compare two dictionaries, the program is written in C# Visual Studio 2010.
Dictionary members1 = new Dictionaries{
{1, "adam"},
{2, "bob"},
{3, "cameron"}
}
Dictionary members2 = new…

sora0419
- 2,308
- 9
- 39
- 58
2
votes
2 answers
comparing two arrays in PHP
I have an array in PHP $array which has elements like
$array['id'].. $array['name'] $array['class']
I have another array called $array1 which has element only $array1['uid'].
I want to match these two array on the basis of $array['id'] and…
user1765876
2
votes
1 answer
JPA Criteria API arbitrary number of joins/subqueries
I need to construct an intersect-type query with the following entities (reduced down for clarity).
@Entity // and other @ stuff
public class Member {
@Id
private Long id;
private String name;
...
}
@Entity
public class Program {
…

Zlatko
- 18,936
- 14
- 70
- 123
2
votes
1 answer
Msg 8623:The query processor ran out of internal resources and could not produce a query plan
I have a very long query which uses distinct intersect, when the query grows too long and I execute it it throws above exception
SELECT DISTINCT RTypeId FROM dbo.User_Res WHERE UserId = '1749'
INTERSECT SELECT DISTINCT RTypeId FROM dbo.User_Res…

G--
- 497
- 1
- 8
- 25
2
votes
2 answers
Can I get a relational intersection or difference using Slick 2?
I'm using Slick versian 2.0.0-M3. If I have two Querys representing relations of the same type, I see there is a union operator to inclusively disjoin them, but I don't see a comparable operator for obtaining their intersection nor their…

Adam Mackler
- 1,980
- 1
- 18
- 32
2
votes
3 answers
Get intersection between two lists
I want to intersect two lists (with NOT), and return the elements of list A that are not present in list B.
example:
>>> a = [1,2,3,4,5]
>>> b = [1,3,5,6]
>>> list(set(a) ????? set(b))
[2, 4]

fj123x
- 6,904
- 12
- 46
- 58
2
votes
1 answer
Timestamp Processing Brain Teaser
I am processing 1Hz timestamps (variable 'timestamp_1hz') from a logger which doesn't log exactly at the same time every second (the difference varies from 0.984 to 1.094, but sometimes 0.5 or several seconds if the logger burps). The 1Hz dataset…

user1854628
- 253
- 3
- 14
2
votes
2 answers
MySQL intersect on strings?
I do have two tables:
Quest
- (int) id
- (text) characters
User
- (int) id
- (text) characters
Entries look like this:
Quest
id | characters
1 | abcdefgh
2 | mkorti
3 | afoxi
4 | bac
User
id | characters
1 | abcd
Now I want to select the…

Langdi
- 229
- 1
- 10