[SQL] DISTINCT

2002-09-12 Thread Rudi Starcevic
Hello, I'd like to select from one table ( contains duplicates ) into a new table. However the new table is exactly the same as the original ( duplicates included ) I think I have a problem with my DISTINCT clause - sql below. It seems the DISTINCT is applied to the whole row not just the 'phon

[SQL] Distinct Values

2001-06-05 Thread Nicolas
Hi, I'm trying to retreive DISTINCT Values from a two colomn table called "Books". The colomns are named "Author" and "URL". DISTINCT values should be retieved from the "Author" Colomn , and then I should be able to retrieve the corresponding URL. How do I build the SQL Query ? I tried to use: "S

Re: [SQL] DISTINCT

2002-09-12 Thread Christopher Kings-Lynne
> SELECT > DISTINCT phone, > company_name, > address, > state, > idc_desc_1, > street_number, > street_name, > street_xtra, > suburb, > postcode, > area_code, > ac_phone, > fax_area_code, > fax_phone, > fax_ac_phone, > latitude, >

Re: [SQL] DISTINCT

2002-09-12 Thread Rudi Starcevic
Christopher, Thank you. I though if I'm lucky Chris will be online and will see that one. Kind regards Rudi. ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere"

[SQL] DISTINCT ON

2002-09-12 Thread Rudi Starcevic
Hi, Just quickly, DISTINCT ON - Is that Postgresql only ? Thanks ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html

[SQL] DISTINCT ON

2005-11-18 Thread Jeremy Palmer
Hi, I have a table: observation ( id int4 NOT NULL [PRIMARY KEY], vector_id NOT NULL [FORGIEN KEY], obs_type VARCHAR(4) NOT NULL, date TIMESTAMP NULL ) I need to select the newest observation id, classify by type, for each vector (there can be multiple observation ids on each vector)

[SQL] Distinct oddity

2009-05-07 Thread Maximilian Tyrtania
Hi there, does this look right? FAKDB=# select count(distinct(f.land)) from firmen f where f.typlist='Redaktion'; count --- 1975 (1 row) FAKDB=# select count(distinct(f.land||'1')) from firmen f where f.typlist='Redaktion'; count --- 4944 (1 row) FAKDB=# select version();

[SQL] distinct date problem

2001-02-26 Thread Lotus118
Hi, I'm having difficulty figuring this one out: I have a table with record entries which all have a date attribute, looking something like '2000-11-11'. What I want from my data base is a list of all the years that are present in this attribute in the relation. So for example, if I had a cou

Re: [SQL] Distinct Values

2001-06-05 Thread Stephan Szabo
On Wed, 30 May 2001, Nicolas wrote: > Hi, > > I'm trying to retreive DISTINCT Values from a two colomn table called > "Books". The colomns are named "Author" and "URL". > DISTINCT values should be retieved from the "Author" Colomn , and then I > should be able to retrieve the corresponding URL.

RE: [SQL] Distinct Values

2001-06-06 Thread KuroiNeko
> Author URL > --- > A http://www.xyz http://www.abc .com > - - > B http://www.def http://www.ijk http://www.rst .com > - - > > If that is what you want, you cannot manage it. Sure, in no way this is possible with SQL (in

[SQL] DISTINCT peformance differences

2002-08-14 Thread Christopher Kings-Lynne
If art_id is the primary key of the la table, is the latter faster? SELECT DISTINCT la.* FROM ... or SELECT DISTINCT ON (la.art_id) la.* FROM ... ie. Does this offer a performance improvement by only doing the distinct on the primary key or not? Thanks, Chris ---(

Re: [SQL] DISTINCT ON

2002-09-12 Thread Christopher Kings-Lynne
Don't know. I've seen it elsewhere so it might even be "standard". Chris > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf Of Rudi Starcevic > Sent: Friday, 13 September 2002 10:50 AM > To: [EMAIL PROTECTED] >

[SQL] DISTINCT ON troubles

2004-02-19 Thread Jeremy Smith
Hi, I have a query that reads: SELECT DISTINCT ON (messageboard.threadid) messageboard.threadid, messageboard.topic, owner.ownerid, owner.username FROM messageboard, owner WHERE messageboard.ownerid=owner.ownerid AND messageboard.leagueid = '$leagueid' ORDER BY messageboard.messageid DESC LIMIT $

Re: [SQL] DISTINCT ON

2005-11-18 Thread Michael Glaesemann
On Nov 19, 2005, at 7:49 , Jeremy Palmer wrote: SELECT DISTINCT ON (vector_id, obs_type) id FROM observation ORDER BY vector_id, obs_type, date DESC; However the documentation also states that "DISTINCT ON" is not part of the SQL standard and should be avoided when po

Re: [SQL] DISTINCT ON

2005-11-18 Thread Jeremy Palmer
further suggestions? -Original Message- From: Michael Glaesemann [mailto:[EMAIL PROTECTED] Sent: Saturday, 19 November 2005 12:28 p.m. To: Jeremy Palmer Cc: pgsql-sql@postgresql.org Subject: Re: [SQL] DISTINCT ON On Nov 19, 2005, at 7:49 , Jeremy Palmer wrote: > SELECT DISTINCT

Re: [SQL] DISTINCT ON

2005-11-18 Thread Michael Glaesemann
-Original Message- From: Michael Glaesemann [mailto:[EMAIL PROTECTED] Sent: Saturday, 19 November 2005 12:28 p.m. On Nov 19, 2005, at 7:49 , Jeremy Palmer wrote: SELECT DISTINCT ON (vector_id, obs_type) id FROM observation ORDER BY vector_id, obs_type, date

Re: [SQL] DISTINCT ON

2005-11-18 Thread Jeremy Palmer
> -Original Message- > From: Michael Glaesemann [mailto:[EMAIL PROTECTED] > Sent: Saturday, 19 November 2005 4:07 p.m. > To: Jeremy Palmer > Cc: pgsql-sql@postgresql.org > Subject: Re: [SQL] DISTINCT ON > > [Please don't top post. It makes the post harder

Re: [SQL] DISTINCT ON

2005-11-19 Thread Bruno Wolff III
On Sat, Nov 19, 2005 at 17:06:27 +1300, Jeremy Palmer <[EMAIL PROTECTED]> wrote: > > Interesting enough, on my server the "distinct on" clause that I originally > ran takes 10% of execution time that the query you provided does. If DISTINCT ON wasn't useful, I doubt it would have been added. -

[SQL] distinct with sum

2006-07-09 Thread mbobi
I need to list products from the table of ordered products with ordered quantities. Each product should be there only once but quantity should be a sum from all the same products from the table. I prepared some query but in quantity column I can see only amount from one record. I need to have su

Re: [SQL] Distinct oddity

2009-05-07 Thread Scott Marlowe
On Thu, May 7, 2009 at 2:21 AM, Maximilian Tyrtania wrote: > Hi there, > > does this look right? > > FAKDB=# select count(distinct(f.land)) from firmen f where > f.typlist='Redaktion'; >  count > --- >  1975 > (1 row) > > FAKDB=# select count(distinct(f.land||'1')) from firmen f where > f.typl

Re: [SQL] Distinct oddity

2009-05-08 Thread Maximilian Tyrtania
am 07.05.2009 20:54 Uhr schrieb Scott Marlowe unter scott.marl...@gmail.com: > On Thu, May 7, 2009 at 2:21 AM, Maximilian Tyrtania > wrote: >> Hi there, >> >> does this look right? >> >> FAKDB=# select count(distinct(f.land)) from firmen f where >> f.typlist='Redaktion'; >>  count >> --- >>

Re: [SQL] Distinct oddity

2009-05-08 Thread Scott Marlowe
On Fri, May 8, 2009 at 3:28 AM, Maximilian Tyrtania wrote: > am 07.05.2009 20:54 Uhr schrieb Scott Marlowe unter scott.marl...@gmail.com: > >> On Thu, May 7, 2009 at 2:21 AM, Maximilian Tyrtania >> wrote: >>> Hi there, >>> >>> does this look right? >>> >>> FAKDB=# select count(distinct(f.land)) f

Re: [SQL] Distinct oddity

2009-05-08 Thread Rob Sargent
Is firmen a table or a view? From: Scott Marlowe To: Maximilian Tyrtania Cc: pgsql-sql@postgresql.org Sent: Friday, May 8, 2009 5:35:21 AM Subject: Re: [SQL] Distinct oddity On Fri, May 8, 2009 at 3:28 AM, Maximilian Tyrtania wrote: > am 07.05.2009 20

Re: [SQL] Distinct oddity

2009-05-08 Thread Tom Lane
Maximilian Tyrtania writes: > am 07.05.2009 20:54 Uhr schrieb Scott Marlowe unter scott.marl...@gmail.com: >> Yeah, that does seem odd. Could it be something like nulls in your >> data set? just guessing really. If you could make a small test case >> that shows it happening and allows others to

Re: [SQL] Distinct oddity

2009-05-09 Thread Maximilian Tyrtania
am 08.05.2009 16:55 Uhr schrieb Rob Sargent unter robsarg...@rocketmail.com: >Is firmen a table or a view? It's a table. am 08.05.2009 21:52 Uhr schrieb Tom Lane unter t...@sss.pgh.pa.us: >> It doesn't seem to be related to null values (which wouldn't explain it >> anyway) nor to this particula

Re: [SQL] Distinct oddity

2009-05-09 Thread Tom Lane
Maximilian Tyrtania writes: > FAKDB=# select distinct f.bezeichnung from firmen f order by 1 limit 5 > FAKDB-# ; >bezeichnung > - > Šsterreichisches Verkehrsbro AG > \x01Assistenz > \x10Frohstoff Design & Textilveredelung > "1. Mittels

Re: [SQL] Distinct oddity

2009-05-09 Thread Glenn Maynard
On Sat, May 9, 2009 at 10:33 AM, Tom Lane wrote: > That only proves that adding the 'e' changes the sort order, which is > completely unsurprising for any non-C locale. What you need to do is > dump out the *entire* results of the DISTINCT queries and look for the > unmatched lines. I'd try dump

Re: [SQL] Distinct oddity

2009-05-09 Thread Alvaro Herrera
Maximilian Tyrtania wrote: > am 08.05.2009 16:55 Uhr schrieb Rob Sargent unter robsarg...@rocketmail.com: > > and what locale are you running in? > > lc_collate | de_DE > | Shows the collation order locale. > lc_ctype| de_DE > | Shows the character c

Re: [SQL] Distinct oddity

2009-05-10 Thread Maximilian Tyrtania
am 10.05.2009 4:58 Uhr schrieb Alvaro Herrera unter alvhe...@commandprompt.com: >>> and what locale are you running in? >> >> lc_collate | de_DE >> | Shows the collation order locale. >> lc_ctype| de_DE >> | Shows the character classification and cas

Re: [SQL] Distinct oddity

2009-05-11 Thread Alvaro Herrera
Maximilian Tyrtania wrote: > am 10.05.2009 4:58 Uhr schrieb Alvaro Herrera unter > alvhe...@commandprompt.com: > > I'd try checking if the problem is reproducible in > > de_DE.utf8 (you need to create a new database for testing, obviously). > > Wait a minute. I need to re- initdb with de_DE.UTF-8

Re: [SQL] Distinct oddity

2009-05-12 Thread Alvaro Herrera
Maximilian Tyrtania wrote: > am 11.05.2009 16:38 Uhr schrieb Alvaro Herrera unter > alvhe...@commandprompt.com: > > >>>Note that the de_DE locale uses Latin9 encoding, which is incompatible > >>>with UTF8. > >>> I'd try checking if the problem is reproducible in > >>> de_DE.utf8 (you need to crea

Re: [SQL] Distinct oddity

2009-05-12 Thread Maximilian Tyrtania
am 11.05.2009 16:38 Uhr schrieb Alvaro Herrera unter alvhe...@commandprompt.com: >>>Note that the de_DE locale uses Latin9 encoding, which is incompatible >>>with UTF8. >>> I'd try checking if the problem is reproducible in >>> de_DE.utf8 (you need to create a new database for testing, obviously)

Re: [SQL] Distinct oddity

2009-05-12 Thread Maximilian Tyrtania
am 12.05.2009 19:23 Uhr schrieb Alvaro Herrera unter alvhe...@commandprompt.com: >> FAKDB=# CREATE DATABASE "TestLatin9" >> FAKDB-# WITH ENCODING='LATIN9' >> FAKDB-#OWNER=postgres; >> ERROR: encoding LATIN9 does not match server's locale de_DE >> DETAIL: The server's LC_CTYPE setting r

Re: [SQL] Distinct oddity

2009-05-13 Thread Maximilian Tyrtania
am 09.05.2009 16:33 Uhr schrieb Tom Lane unter t...@sss.pgh.pa.us: > What you need to do is > dump out the *entire* results of the DISTINCT queries and look for the > unmatched lines. I'd try dumping to two files, stripping the 'e' with > sed, and then sort/diff. Okay, that's what I did, and the

Re: [SQL] Distinct oddity

2009-05-13 Thread Tom Lane
Maximilian Tyrtania writes: > am 12.05.2009 19:23 Uhr schrieb Alvaro Herrera unter > alvhe...@commandprompt.com: >> What platform are you using anyway? > Mac OS 10.4.11 I have some vague recollection that UTF8-using locales don't actually work well on OSX ... check the archives ...

Re: [SQL] Distinct oddity

2009-05-13 Thread Tom Lane
I wrote: > Maximilian Tyrtania writes: >> am 12.05.2009 19:23 Uhr schrieb Alvaro Herrera unter >> alvhe...@commandprompt.com: >>> What platform are you using anyway? >> Mac OS 10.4.11 > I have some vague recollection that UTF8-using locales don't actually > work well on OSX ... check the archive

Re: [SQL] Distinct oddity

2009-05-13 Thread Glenn Maynard
For purposes of DISTINCT, I'd expect any sort order should do; all it needs is for equal values to be grouped together. If strcoll() ever fails to do that, I'd call it a critical bug--even throwing total garbage at it should result in a consistent ordering, even if the ordering itself is totally m

Re: [SQL] Distinct oddity

2009-05-13 Thread Tom Lane
Glenn Maynard writes: > For purposes of DISTINCT, I'd expect any sort order should do; all it > needs is for equal values to be grouped together. If strcoll() ever > fails to do that, I'd call it a critical bug--even throwing total > garbage at it should result in a consistent ordering, even if t

Re: [SQL] distinct date problem

2001-02-26 Thread Michael Fork
This should work: SELECT distinct(date_part('year', )) FROM <>; Michael Fork - CCNA - MCP - A+ Network Support - Toledo Internet Access - Toledo Ohio On Sun, 25 Feb 2001, Lotus118 wrote: > Hi, > I'm having difficulty figuring this one out: > I have a table with record entries which all have a

[SQL] DISTINCT ON () with UNION

2001-05-13 Thread pgsql
How can you use a distinct on () including the whole union. eg select distinct on (valutaid) valutaid, short from valuta UNION select landid, land from land order by valutaid; table: valuta valutaidvaluta 1 USD 2 SEK table: land landid land 1

Re: [SQL] DISTINCT ON troubles

2004-02-19 Thread Josh Berkus
Jeremy, > Am I just approaching this all wrong and need to create a temporary table > and draw from that, or is there a way to salvage this query? Think about using a subquery instead of the DISTINCT ON approach. I don't think you can get what you want with DISTINCT ON. A temporary table is n

Re: [SQL] DISTINCT ON troubles

2004-02-19 Thread Jeremy Smith
Thanks Josh, I'll do that, I just wasn't sure if I was missing something obvious. Jeremy -Original Message- From: Josh Berkus [mailto:[EMAIL PROTECTED] Sent: Thursday, February 19, 2004 2:29 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [SQL] DISTINCT ON trouble

Re: [SQL] DISTINCT ON troubles

2004-02-19 Thread Brian Knox
( sorry if this is a repeat, my mail server is being wonky today ) I'm looking for a way, within SQL, given a starting date and an ending date, to get back the number of months between the start and end date. If I "SELECT end_date - start_date", I get back an interval in days; I need months. T

Re: [SQL] DISTINCT ON troubles

2004-02-19 Thread scott.marlowe
On Thu, 19 Feb 2004, Brian Knox wrote: > ( sorry if this is a repeat, my mail server is being wonky today ) > > I'm looking for a way, within SQL, given a starting date and an ending > date, to get back the number of months between the start and end date. > If I "SELECT end_date - start_date",

Re: [SQL] DISTINCT ON troubles

2004-02-19 Thread scott.marlowe
On Thu, 19 Feb 2004, scott.marlowe wrote: > On Thu, 19 Feb 2004, Brian Knox wrote: > > > ( sorry if this is a repeat, my mail server is being wonky today ) > > > > I'm looking for a way, within SQL, given a starting date and an ending > > date, to get back the number of months between the start

Re: [SQL] distinct with sum

2006-07-09 Thread Hélder M . Vieira
I need to list products from the table of ordered products with ordered quantities. Each product should be there only once but quantity should be a sum from all the same products from the table. I prepared some query but in quantity column I can see only amount from one record. I need to have su

[SQL] DISTINCT ON not working...?

2007-02-19 Thread Phillip Smith
Hi all, Strange one - I have a nightly export / import routine that exports from one database and imports to another. Has been working fine for several months, but last night it died on a unique constraint. To cut out all the details, the code that is causing the problem: SELECT DISTINCT

[SQL] distinct / group by assistance.

2008-06-28 Thread Gavin 'Beau' Baumanis
Hi Everyone, I am having some issues trying to create the required SQL that will allow me to return the results I am after. I have been trying various incarnations, using group by, sub-queries - albeit to no avail - for the past three hours. Consider the following simple SQL; select a

Re: [SQL] DISTINCT ON () with UNION

2001-05-13 Thread Tom Lane
[EMAIL PROTECTED] writes: > How can you use a distinct on () including the whole union. In 7.1 you can write select distinct ... from (select ... union select ...) ss; regards, tom lane ---(end of broadcast)--- TIP 3: if p

[SQL] distinct values without seq scan

2004-04-06 Thread Bret Hughes
I have a table indexed on a char(35) field and want a query to return a distinct list of the values in this column. Is there some syntactical magic I can do to get these values without a sequential scan? I assume, ( here we go again ) that these values are in the index somewhere and I seem to rec

Re: [SQL] DISTINCT ON not working...?

2007-02-19 Thread Tom Lane
"Phillip Smith" <[EMAIL PROTECTED]> writes: > To cut out all the details, the code that is causing the problem: > SELECT DISTINCT ON (ean) > code, > CASE WHEN ean IS NULL OR valid_barcode(ean) = false THEN > null ELSE ean END AS ean > FROMTMPTABL

Re: [SQL] DISTINCT ON not working...?

2007-02-19 Thread Phillip Smith
[mailto:[EMAIL PROTECTED] Sent: Tuesday, 20 February 2007 15:33 To: Phillip Smith Cc: pgsql-sql@postgresql.org Subject: Re: [SQL] DISTINCT ON not working...? Perhaps you've confused yourself by using "ean" as both an input and an output column name? I think that the "ean

Re: [SQL] DISTINCT ON not working...?

2007-02-20 Thread Marcin Stępnicki
Dnia Tue, 20 Feb 2007 15:36:32 +1100, Phillip Smith napisał(a): > Removing the CASE statement all together: > SELECT DISTINCT ON (ean) > ean, > count(*) > FROMTMPTABLE > WHERE code NOT IN (SELECT code FROM stock_deleted) > ANDean IS NOT NULL > GROUP BY ean > > Still gi

Re: [SQL] DISTINCT ON not working...?

2007-02-20 Thread Phillip Smith
: pgsql-sql@postgresql.org Subject: Re: [SQL] DISTINCT ON not working...? Wild guess - have you tried reindexing this table? I haven't seen corrupted indexes since 7.1, though - it usually means subtle hardware problems. ***Confidentiality and Privilege Notice***

Re: [SQL] distinct / group by assistance.

2008-06-28 Thread Tom Lane
"Gavin 'Beau' Baumanis" <[EMAIL PROTECTED]> writes: > ... If there a multiple rows of the same id in table1, I get all > (multiple) rows - as you would expect - of course. > What I need however, is only one row returned per instance a.id that > is returned by the above query. You need GROUP B

Re: [SQL] distinct / group by assistance.

2008-06-28 Thread Gavin 'Beau' Baumanis
Hi Tom I am a nut. please find below my correct requirements. select a.foo, b.bar, c.something from table1 a, inner join table2 b on b.id =a.id left outer join table3 on c.id = a.id If there a multiple rows of the same id in table2,(one (a) to many (b) relatio

Re: [SQL] distinct values without seq scan

2004-04-07 Thread Josh Berkus
Bret, > I have a table indexed on a char(35) field and want a query to return a > distinct list of the values in this column. Is there some syntactical > magic I can do to get these values without a sequential scan? I assume, > ( here we go again ) that these values are in the index somewhere an

[SQL] DISTINCT with NULLs and INT fields

2005-12-28 Thread George Pavlov
What does The SQL Standard say about this one? create table foo (a varchar, b int); insert into foo (a, b) select null, null from bar; -- no problem insert into foo (a, b) select distinct null, null from bar; -- ERROR: column "b" is of type integer but expression is of type text -- HINT: You w

Re: [SQL] DISTINCT ON not working... RESOLVED

2007-02-22 Thread Phillip Smith
This has been resolved -- although I still think it may be a bug in Postgres. I'm confused as hell, it's Friday, and it's hot though... So I'll have to think about it over the weekend and let you know if I can make sense of it. Thanks all for your suggestions. Cheers, ~p -Original Message-

Re: [SQL] DISTINCT with NULLs and INT fields

2005-12-28 Thread Tom Lane
"George Pavlov" <[EMAIL PROTECTED]> writes: > What does The SQL Standard say about this one? > insert into foo (a, b) select distinct null, null from bar; > -- ERROR: column "b" is of type integer but expression is of type text According to the SQL spec that query is illegal on its face --- the

Re: [SQL] DISTINCT with NULLs and INT fields

2005-12-28 Thread George Pavlov
> "Better" is in the eye of the beholder. sorry for the value-laden term. "laxer" is more appropriate, of course! the funny thing is that had they cast the NULLs to TEXT it would have failed there too (they do not do implicit TEXT to INT). > It surprises me not at all that > Microsoft would be

Re: [SQL] DISTINCT with NULLs and INT fields

2005-12-28 Thread Tom Lane
"George Pavlov" <[EMAIL PROTECTED]> writes: > indeed! but, wait, doesn't our favorite dbms do some implicit casting > too? continuing with my table foo (a varchar, b int): > test=# delete from foo; > DELETE 2 > test=# insert into foo values (4,4); > INSERT 0 1 > test=# insert into foo values ('4',

Re: [SQL] DISTINCT with NULLs and INT fields

2005-12-28 Thread George Pavlov
> Sure, but in this example the required type of the value is clear from > immediate context (ie, the INSERT). This is one of the cases where > the SQL spec requires a bare NULL to be accepted. (BTW, 'no' and '4' > in this example are *not* values of type text; they are > untyped literals which

Re: [SQL] DISTINCT with NULLs and INT fields

2005-12-28 Thread Alvaro Herrera
George Pavlov wrote: > test=# insert into foo values (4::int,4::int); > INSERT 0 1 > test=# insert into foo values (4::text,4::text); > ERROR: column "b" is of type integer but expression is of type text > HINT: You will need to rewrite or cast the expression. > test=# insert into foo values (ca

Re: [SQL] DISTINCT with NULLs and INT fields

2005-12-28 Thread George Pavlov
> > test=# insert into foo values (4::int,4::int); > > INSERT 0 1 > > test=# insert into foo values (4::text,4::text); > > ERROR: column "b" is of type integer but expression is of type text > > HINT: You will need to rewrite or cast the expression. > > test=# insert into foo values (cast(4 as

Re: [SQL] DISTINCT with NULLs and INT fields

2005-12-28 Thread Tom Lane
"George Pavlov" <[EMAIL PROTECTED]> writes: > the interesting thing here is that 4::int gets into a text > field whereas 4::text does not get into an integer field. seems to me > like there is an implicit int-to-text cast (without a symmetrical > text-to-int one) Yeah, there is. You can easily se

[SQL] HELP w/ SQL -- distinct select with non distinct fields?

2002-09-27 Thread RVL
I'm work with Sybase on the Sun... and, being a clueles newbee in SQL department, hope you could help. I have a set of data: acct name qty link date memo 101 item_A 100 0001 9/2/02 blah 101 item_A 250 0001 9/3/02 n/a 101 item_A80 0002 9/3/02 n/a 101 item_B90 000

Re: [SQL] HELP w/ SQL -- distinct select with non distinct fields?

2002-09-27 Thread John Gilson
"RVL" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I'm work with Sybase on the Sun... and, being a clueles newbee in SQL > department, hope you could help. I have a set of data: > > acct name qty link date memo > 101 item_A 100 0001 9/2/02 blah

[SQL] distinct aggregate with complex type dont see the equality operator

2006-06-03 Thread Thomas Chille
Dear List, i want to built an aggregate function wich should summing up values in a distinct manner: dsum(DISTINCT ROW(value, distinction)). I implemented all things i thought i need but it dont work. i get always an 'could not identify an equality operator for type dsum_type'-error nevertheles

Re: [SQL] distinct aggregate with complex type dont see the equality operator [solved]

2006-06-03 Thread Thomas Chille
using DISTINCT with complex types depends on an OPERATOR CLASS for B-Tree-Indexes i found out. the error msg 'could not identify an equality operator for type' was confusing. i post this complete example. maybe someone else is running in this problem too. regards, thomas! CREATE TYPE named_va