Questions tagged [set-operations]

Set operations as a branch of set theory which includes operations such as: Union, Intersection, Subset, Set Difference, Symmetrical Set Difference, and Set Equality.

References

88 questions
0
votes
4 answers

jquery exclude array elements

I have an array of elements which I want to maintain efficiently, adding and removing arrays of elements over time. var myElements = $('.initial'); jquery's merge() seems perfect for adding items as it doesn't create a new array and just adds to…
jozxyqk
  • 16,424
  • 12
  • 91
  • 180
0
votes
0 answers

using set operators VS subqueries in sql language

Can anyone suggest me what's the difference between using set operators and subqueries in sql language? Difference parameters can be functional, performance-wise, compatibility, integration with existing systems and scalability.
Shyam
  • 9
0
votes
2 answers

How to find same as using sub-query and set operation

I am trying to get instructors who are teaching students that live in same zipcode as the instructor. First I found what zipcodes were shared by students and instructors using intersect. SELECT DISTINCT FIRST_NAME,LAST_NAME,PHONE FROM INSTRUCTOR …
Manual
  • 1,627
  • 5
  • 17
  • 20
0
votes
2 answers

SQL Using to_char(null), to_number(null), etc in set operators with Oracle

I'm a student entering the world of SQL for the first time and I cannot find any clear and understandable documentation on how to use to_somedatatype(null) to substitute for missing columns in a UNION, INTERSECT, etc. I'm using the HR schema that…
Troy D
  • 381
  • 2
  • 4
  • 17
-1
votes
1 answer

Finding complement of a set in prolog

suppose i've defined three clubs in Prolog: club(football, [john, mary, peter, jane]). club(basketball, [peter, jane, tom, kim]). club(dance, [emily, andrew, john, jacob]). now i wish to find the complement of football club from the combined…
Raven
  • 23
  • 5
-1
votes
2 answers

Best way to do set arithmetic in SQLite

Member-Role is N:N relationship. Member MemberRole Role +----------+ +----------+ +----------+ | Id | | MemberId | | Id | | ... | | RoleId | | Name | +----------+ +----------+ …
ikegami
  • 367,544
  • 15
  • 269
  • 518
-1
votes
1 answer

My Array only goes up to 3 values and my second Array repeats whatever the user entered into the 2nd array

I have changed up my code to be vectors. Now I am trying to find the Union, Intersection, and A-B. My code for both Union and Intersection now is working. I can not figure out how to do my difference. I figured I could take A and if it == to B then…
user12156968
-1
votes
1 answer

when 2 output values are returned it should display the hardcorded one and if 1 output value is returned it should display the 1output itself

When I execute a query for input parameter ABC it returns two values (Partner, Smith); whenever two values are returned of those two values Smith will be a compulsory value which will be returned. But whenever the same query is executed with input…
Naresh
  • 1
-1
votes
2 answers

T-SQL: Set Operations Equivalent for cursor operation

I have a table like below where I iterate using a cursor to replace one value for another. Is there a way to do this using set operations in SQL? In this example, I would replace the column with value 2525 with the value 255 and iterate through…
Abe
  • 6,386
  • 12
  • 46
  • 75
-2
votes
3 answers

Set operations (complement and difference)

How can I make set complement and set difference in C# without using any collections and Linq? We have two arrays: int [] arr1 = new int { 1, 2, 3, 4}; int[] arr2 = new int {3,4,5,6,7,8}; Complement must be: arr3 {5,6,7,8} and the difference must…
-2
votes
1 answer

How to write optimized query for multiple prioritize conditional joins in SQL server?

The scenario I'm after for is : Result = Nothing CollectionOfTables = Tbl1, Tbl2, Tbl3 While(True){ CurrentTable = GetHighestPriorityTable(CollectionOfTables) If(CurrentTable) = Nothing Then Break Loop; …
Mohsen Sarkar
  • 5,910
  • 7
  • 47
  • 86
-3
votes
2 answers

How to replace values in one dictionary that are the keys of another?

I have two dictionaries, one that stores country names and another that holds the respective country lat,long coordinates. I'd like to replace the values of path_dict with the values of the matching key in another dictionary. pathcoord_dict =…
-5
votes
1 answer

How to perform A-B set operation in C program using builtin library

I am new to C language. Suppose I have two arrays a and b int a[10] = { 1,2,3,4,5,6,7,8,9,0 }; int b[10] = { 1,3,5,7,9 }; and I want to perform a-b so that I can get all elements of array a which are not present in array b. In ruby or python, I can…
Sachin Singh
  • 7,107
  • 6
  • 40
  • 80
1 2 3 4 5
6