Questions tagged [union]

Use this tag only for questions about UNION, a keyword of the SQL language for combining the results of multiple SQL queries. Use [union-all] for the UNION-ALL keyword. Use the tag [unions] for unions in C, C++, and similar languages.

Filter by
Sorted by
Tagged with
0
votes
0answers
13 views

Ruby on Rails - Combining #or and #joins

I'm working on a RoR application and I'm running into the following problem: I have a model A that belongs_to up to two separate instances of another model B, and I want to define a scope that returns ...
0
votes
1answer
30 views

Quick Union Algorithm in Java

This is a code in the course Algorithms by Stanford that uses Quick Union to solve dynamic connectivity. public class QuickUnionUF { private int[] id; // Set id of each object to itself ...
0
votes
0answers
28 views

C: How to interpret the union containing 2 struct objects? ULARGE_INTEGER [duplicate]

I have a question about the interpretation of this union object. From the win32 API docs: https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-ularge_integer-r1 typedef union ...
-2
votes
1answer
17 views

Django ORM make Union Query with column not in common in both tables, set value of not in common column as null

Hi i want to make a query in Djang ORM like this Select Col1, Col2, Col3, Col4, Col5 from Table1 Union Select Col1, Col2, Col3, Null as Col4, Null as Col5 from Table2 as you see Col4, Col5 are not in ...
1
vote
1answer
26 views

SQLite, insert or ignore based on result of a union subquery

INSERT INTO table (field1, field2, field3, field4) VALUES (@field1, @field2, @field3, @field4) WHERE NOT EXISTS ( SELECT 1 FROM table WHERE field1 = @field1 AND field2 = @field2 UNION ...
-1
votes
0answers
11 views

echo union all tables [closed]

Siema, prowadz? serwis o tematyce pi?ki no?nej. Posiadam 5 tabel mysql. W ka?dej z osobna znajduje si? inna liga. Serie A, Premier League,. Itd. Ka?da posiada 20 rekordów. Tyle ile jest dru?yn w danej ...
2
votes
1answer
24 views

What is the difference between union and union all in SQL? [duplicate]

Difference between union and union all?
1
vote
1answer
20 views

Read a list of csv files from datalake and union them into a single pyspark dataframe

I am trying to read a list of csv files from Azure datalake one by one and after some checking, I want to union all into a single dataframe. fileList = dbutils.fs.ls(file_input_path) for i in ...
-4
votes
2answers
18 views

Left join with union [MYSQL]

I have two queries. Both works fine: SELECT * FROM newser t1 LEFT JOIN users t2 ON t1.userid = t2.usid WHERE t1.univer = '210310213053' LIMIT 1 second query: SELECT * FROM newser ORDER by RAND() ...
-3
votes
0answers
27 views

Duplicate Record with hierarchy (parent and child records) [closed]

I have one table named by tblticket. we have functionality to point other tickets (db records) as duplicate of selected ticket(selected record) . similarly selected ticket (selected record) can be ...
0
votes
2answers
31 views

SQL combine two queries grouped with new names

I don't know if the question is phrased correctly since I'm not sure what I'm looking for. Sorry for that... I have an PHP-script which creates a pie-chart and takes input from SQL-query as follows: ...
0
votes
1answer
16 views

MS Access From Wide Format to Long Format New variable Union ALL

I'm a newbie at MS Access and need some help. I have a table that looks like this: ID HDD CDD HDDKEY CDDKEY 186 -1 -1 1 5 and would like the following: ID HDD CDD KEY 186 -1 0 1 186 0 -1 5 My ...
-1
votes
1answer
28 views

SQL - Union with case when and group by - HELP needed

I'm working with my first union cases, and I don't understand how should I overcome the following issue. Will appreciate the masters' help :) The query :) select Team, sum(Scored) as Scored, sum(...
1
vote
1answer
22 views

Extract Record Key Types into Union Type

Given: interface ActionA { type: 'AAAA'; stuff: string[]; } interface ActionB { type: 'BBBB'; otherStuff: string[]; } Is there something like: type ActionTypes = ExtractToUnion<ActionA | ...
-1
votes
1answer
27 views

Union and left join of three tables

I have three tables A, B, AB. Table A has 60 mobile numbers and a scoreA for each mobile number. Table B has 40 mobile numbers and a scoreB for each mobile number. Table AB has 40 mobile numbers from ...

15 30 50 per page
1
2 3 4 5
317
久草视频新免费_日韩视频一中文字暮_欧美三级片