>
> 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
> )a
ple who replied (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]
On Mon, 17 May 2004, Stijn Vanroye wrote:
> 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
> select task_id, w
in a given period.
This still 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 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 r
is question has risen.
Kind regards,
Stijn Vanroye
> -Original Message-
> From: Edmund Bacon [mailto:[EMAIL PROTECTED]
> Sent: donderdag 13 mei 2004 17:28
> To: sad
> Cc: [EMAIL PROTECTED]
> Subject: Re: [SQL] a wierd query
>
>
> sad wrote:
> > select
2004 9:26
> To: [EMAIL 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
> (
> sel
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
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 DIST
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 broadcast)
IL PROTECTED]>
> To: [EMAIL 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),
>st
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 co
> 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
SELECT foo.value from (select string_a as value from main_table UNION
select string_b as value from main_table) as foo;
O kyrios [EMAIL PROTECTED] egrapse stis May 13, 2004 :
> hi
>
> i have a wierd problem and i require an equally weird query.
> 1) backgound
> Table test:
> CREATE TABL
[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
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 main_table
16 matches
Mail list logo