select distinct on (date, employee_id) employee_id, date from
(
select distinct on (begindate, employee_id) begindate as date, employ=
ee_id from workhour
UNION
select distinct on (enddate, employee_id) enddate as date, employee_i=
d from workhour
)as dist
(and started the thread) are in place here.
Kind regards,
Stijn Vanroye
-Original Message-
From: Stephan Szabo [mailto:[EMAIL PROTECTED]
Sent: maandag 17 mei 2004 17:01
To: Stijn Vanroye
Cc: [EMAIL PROTECTED]; Edmund Bacon
Subject: Re: [SQL] a wierd query
On Mon, 17 May 2004
PROTECTED]
Cc: 'Edmund Bacon'
Subject: RE: [SQL] a wierd query
Are you sure about that Edmund?
I have the following query:
select distinct on (task_id, date) task_id, workhour_id, date from
(
select task_id, workhour_id, begindate as date from workhour
UNION
I forgot one situation:
if I run the query like so:
select distinct on (task_id, begindate) task_id, workhour_id,
begindate as date from workhour UNION
select distinct on (task_id, enddate) task_id, workhour_id, enddate
as date from workhour I get yet another value: 2961 rows.
keeps my question open wether or not a UNION does only show unique values
in the union.
-Original Message-
From: sad [mailto:[EMAIL PROTECTED]
Sent: maandag 17 mei 2004 9:13
To: [EMAIL PROTECTED]
Subject: Re: [SQL] a wierd query
I forgot one situation:
if I run the query
sad wrote:
select distinct a as F from table
union
select distinct b as F from table;
Note that UNION only returns the unique values of the union
You can get repeated values by using UNION ALL.
--
Edmund Bacon [EMAIL PROTECTED]
---(end of
hi
i have a wierd problem and i require an equally weird query.
1) backgound
Table test:
CREATE TABLE main_table (
string_A varchar( 20),
string_B varchar( 20),
);
-- both columns are identical in nature and usage
INSERT INTO
[EMAIL PROTECTED] schrieb:
hi
i have a wierd problem and i require an equally weird query.
1) backgound
Table test:
CREATE TABLE main_table (
string_A varchar( 20),
string_B varchar( 20),
);
-- both columns are identical in nature and usage
i require the dictinct values from (visualizing each column
result as a set) the union of the two columns
select distinct a as F from table
union
select distinct b as F from table;
---(end of broadcast)---
TIP 7: don't forget to increase your
On Thu, 13 May 2004, [EMAIL PROTECTED] wrote:
hi
i have a wierd problem and i require an equally weird query.
1) backgound
Table test:
CREATE TABLE main_table (
string_A varchar( 20),
string_B varchar( 20),
);
-- both columns are
PROTECTED]
Subject: [SQL] a wierd query
hi
i have a wierd problem and i require an equally weird query.
1) backgound
Table test:
CREATE TABLE main_table (
string_A varchar( 20),
string_B varchar( 20),
);
-- both columns are identical
On Thursday 13 May 2004 19:27, you wrote:
sad wrote:
select distinct a as F from table
union
select distinct b as F from table;
Note that UNION only returns the unique values of the union
You can get repeated values by using UNION ALL.
read the original problem
look at the DISTINCT
On Fri, 14 May 2004, sad wrote:
On Thursday 13 May 2004 19:27, you wrote:
sad wrote:
select distinct a as F from table
union
select distinct b as F from table;
Note that UNION only returns the unique values of the union
You can get repeated values by using UNION ALL.
read the
13 matches
Mail list logo