Questions tagged [intersect]

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

643 questions
4
votes
1 answer

Faster alternative to INTERSECT with 'rows' - MATLAB

I have a code written in Matlab that uses 'intersect' to find the vectors (and their indices) that intersect in two large matrices. I found that 'intersect' is the slowest line (by a large difference) in my code. Unfortunately I couldn't find a…
Jack
  • 43
  • 4
4
votes
2 answers

How to Create an Expression tree for .Where(x => x..Select(y => y.id).Intersect(List).Any())

I'm creating a method that receives a Queryable source, a string with a property name/path (could be a deep property for example "TrParent.DataTypes" to achieve this x => x.TrParent.DataTypes) and Enumerable which holds the values I need to…
c0y0teX
  • 1,462
  • 1
  • 23
  • 25
4
votes
1 answer

Intersect two generic lists by dynamic properties

i have two generic lists with a few properties to compare but i want that the key identifiers are dynamic by a List. So lets say we have the class: class A { string Name { get; set; } string Color1 { get; set; } string Color2 {…
kassi
  • 358
  • 1
  • 3
  • 10
4
votes
2 answers

Array intersect Hive

I have two arrays of string in Hive like {'value1','value2','value3'} {'value1', 'value2'} I want to merge arrays without duplicates, result: {'value1','value2','value3'} How I can do it in hive?
Adriano Foschi
  • 648
  • 1
  • 8
  • 23
4
votes
2 answers

How to find matches among two list of names

I have two long vectors of names (list.1, list.2). I want to run a loop to check whether any name in list.2 matches with any name in list.1. If it does I want to append to a vector result the value for the position of the matching name in vector…
CptNemo
  • 6,455
  • 16
  • 58
  • 107
4
votes
3 answers

mysql Alternatives to INTERSECT

I have been trying for the best part of the day to remove the intersect since it is not supported by mysql. If anyone can provide some pointers it would be really helpful. SELECT *, DATE_FORMAT(NOW(), '%Y') - DATE_FORMAT(dob, '%Y') -…
Narcil
  • 325
  • 2
  • 13
4
votes
1 answer

Find length of geometry line after it intersects with geometry polygon using STIntersect

SQL SERVER 2012 I need to find the length of the geometry of a line after I use STIntersect to intersect lines against polygon geometry. For instance, I have a line that is 7731 meters long but then I STIntersect it against a set of polygons, I…
3
votes
1 answer

How to write an Android SQLite database INTERSECT query

I am trying to query my Android SQLite database using the following INTERSECT query, but it crashes. The two select queries work fine on their own and they are definitely producing a matched result, so I can't understand why the INTERSECT statement…
user985869
  • 93
  • 1
  • 8
3
votes
2 answers

Why can't I use LINQ methods on my class implementing IEnumerable?

I have to complete a project but I have a simple problem I have a class defined in this way using System; using System.Collections; using System.Collections.Generic; .. public class GroupId: XmlDataTransferObject, IEnumerable { private IList…
3
votes
2 answers

Intersect on HashSet results in compile error

I've been trying to write a program, in which I want to use the intersection of two HashSets. Therefore I wrote the following code (for test purposes): HashSet test1 = new HashSet() { 1, 3, 5, 7, 9 }; HashSet test2 = new…
Lisa
  • 33
  • 3
3
votes
1 answer

How can do subscription between two SELECT set?

SELECT field1 FROM tbl1 WHERE conditionsx ...? SELECT field2 FROM tbl2 WHERE conditionsy I Want return same below↓ What is superscription between two SELECT results.
parmer_110
  • 325
  • 2
  • 11
3
votes
6 answers

Return TRUE/FALSE if common elements/no common elements between vectors

I'm looking for an efficient way to create a boolean vector which returns TRUE if one or more of a number of specified variables e.g. c(1,2,3) are in another vector e.g. c(4,5,6,1). In this example the output sought would be TRUE as the element 1 is…
ravinglooper
  • 169
  • 5
3
votes
1 answer

how do geopandas sjoin op 'within' and 'intersects' differ

I'm identifying if a point locates within a polygon. I have a dataframe contains the points and another dataframe contains the polygons, so I want to spatial join them like: gpd.sjoin(df_points, df_polygons, how = 'left') I know the default is…
Lumos
  • 1,303
  • 2
  • 17
  • 32
3
votes
4 answers

Common elements by columns in high-dimensional matrix

I have a data like original with much more columns. id <- c('A','B','C', 'D', 'E', 'F', 'G') month <- c('NA', 'D', 'H', 'I', 'A', 'B', 'NA') iso <- c('NA', 'NA', 'NA', 'A', 'B', 'C', 'NA') original <- data.frame(id, month, iso) I want to create a…
vog
  • 770
  • 5
  • 11
3
votes
1 answer

Lookup intersecting values in df2 based on column values in df1 and create a new column with retrieved value in df1 (non matching column names)

New to Python and this is the latest challenge I need help with in df1 I have the following spread of data: data = {'Code': ['53.110.30.0140.','53.110.30.0200.','53.110.30.0240. ','53.110.3130.','53.110.3140.'], 'AA':…
MJKing
  • 57
  • 3