Re: select Distinct question

2004-05-13 Thread SGreen
Hello List, Please forgive this rather lengthy post. I thought I had something worked out to answer Rob's question but when I put it to the test I found what MAY be a bug in 4.1.1a-alpha-nt-log. Here is what I did. I created two tables, tablea and tableb. Here are their defs: mysql show create

SELECT DISTINCT question

2003-10-13 Thread Personal
Hello everybody: I have the following scenario: I have a database of products, each of those products have a product number (like 04543000). Now the first five digits represent the product number, and the 2 following digits represent a differet color for the same product.

Re: SELECT DISTINCT question

2003-10-13 Thread jeffrey_n_Dyke
: Subject: SELECT DISTINCT question 10/13/2003 12:38

RE: SELECT DISTINCT question (Thanks it worked)

2003-10-13 Thread Personal
Thank you!!! It works. Hector -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, October 13, 2003 1:44 PM To: Personal Cc: [EMAIL PROTECTED] Subject: Re: SELECT DISTINCT question SELECT

RE: SELECT DISTINCT question

2003-03-01 Thread Uttam
fields. regds, -Original Message- From: Sheryl Canter [mailto:[EMAIL PROTECTED] Sent: Saturday, March 01, 2003 01:56 To: Juan Nin; [EMAIL PROTECTED] Subject: Re: SELECT DISTINCT question So depending on which columns you were looking at, two rows might seem like duplicates or not? If your

Re: SELECT DISTINCT question

2003-03-01 Thread Sheryl Canter
PROTECTED] Sent: Saturday, March 01, 2003 3:46 AM Subject: RE: SELECT DISTINCT question *DISTINCT omits data bases on selected fields only. i.e. if you have thousand rows having different dates in 'mydate' but all having year 2002, then SELECT DISITNCT YEAR(mydate) will return only 1 row i.e. 2002

Re: SELECT DISTINCT question

2003-02-28 Thread Sheryl Canter
of other ways of handling this. - Sheryl - Original Message - From: Tore Bostrup [EMAIL PROTECTED] To: Sheryl Canter [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, February 28, 2003 1:41 AM Subject: Re: SELECT DISTINCT question DISTINCT works on the result set and across the entire

Re: SELECT DISTINCT question

2003-02-28 Thread Tore Bostrup
if others know of other ways of handling this. - Sheryl - Original Message - From: Tore Bostrup [EMAIL PROTECTED] To: Sheryl Canter [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, February 28, 2003 1:41 AM Subject: Re: SELECT DISTINCT question DISTINCT works on the result

Re: SELECT DISTINCT question

2003-02-28 Thread Frank Peavy
Sheryl, I'm trying to determine which author has the highest royalty percent FOR EACH PROGRAM, not overall. I'm displaying a list of programs and authors, and when there is more than one author, I want to show the principal author (i.e., the one earning the highest royalty percent). Ok, so your

Re: SELECT DISTINCT question

2003-02-28 Thread Sheryl Canter
help. - Sheryl - Original Message - From: Frank Peavy [EMAIL PROTECTED] To: Sheryl Canter [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, February 28, 2003 11:22 AM Subject: Re: SELECT DISTINCT question Sheryl, I'm trying to determine which author has the highest royalty percent

Re: SELECT DISTINCT question

2003-02-28 Thread Sheryl Canter
Canter [EMAIL PROTECTED]; [EMAIL PROTECTED]; Frank Peavy [EMAIL PROTECTED] Sent: Friday, February 28, 2003 12:34 PM Subject: Re: SELECT DISTINCT question At 11:50 -0500 2/28/03, Sheryl Canter wrote: Frank, Sorry that I seem to be explaining this so poorly. I'll try to clarify what I'm trying to do

Re: Re: SELECT DISTINCT question

2003-02-28 Thread Juan Nin
From: Sheryl Canter [EMAIL PROTECTED] DISTINCT removes duplicates: rows that are the same in *all* columns. Would this be all columns in the table, or all columns retrieved by the SELECT statement? in the SELECT statement :) SELECT queries do not alter your rows, you can only do

Re: SELECT DISTINCT question

2003-02-28 Thread Tore Bostrup
x, y, z Form Table is equivalent with SELECT x, y, z FROM Table GROUP BY x, y, z HTH, Tore. - Original Message - From: Sheryl Canter [EMAIL PROTECTED] To: [EMAIL PROTECTED]; Frank Peavy [EMAIL PROTECTED] Sent: Friday, February 28, 2003 11:50 AM Subject: Re: SELECT DISTINCT question

Re: SELECT DISTINCT question

2003-02-28 Thread Sheryl Canter
? - Sheryl mysql - Original Message - From: Juan Nin [EMAIL PROTECTED] To: Sheryl Canter [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, February 28, 2003 2:42 PM Subject: Re: SELECT DISTINCT question From: Sheryl Canter [EMAIL PROTECTED] DISTINCT removes duplicates: rows

Re: SELECT DISTINCT question

2003-02-27 Thread Sheryl Canter
Didn't receive answer to message below. Could someone please take a look? TIA. - Sheryl - Original Message - From: Sheryl Canter [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 26, 2003 11:49 AM Subject: SELECT DISTINCT question I need help with a query. I have

Re: SELECT DISTINCT question

2003-02-27 Thread Frank Peavy
Canter [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 26, 2003 11:49 AM Subject: SELECT DISTINCT question I need help with a query. I have a 'royalties' table that looks like this: AuthorIDProgramIDRoyalty -- Author1 Program1 0.15

Re: SELECT DISTINCT question

2003-02-27 Thread Sheryl Canter
: SELECT DISTINCT question Sheryl, Sorry I don't time to fully address your question but I will try to give you some feedback. The DISTINCT functionality will give you exact that, every distinct instance of the columns you SELECTED. SELECT DISTINCT a.Author FROM author a Will give you each and every

Re: SELECT DISTINCT question

2003-02-27 Thread Don Read
On 27-Feb-2003 Sheryl Canter wrote: snip SELECT * FROM programs p, authors a, royalties r WHERE p.ProgramID = r.ProgramID AND a.AuthorID = r.AuthorID I could change this to SELECT DISTINCT * ..., but then which author would I get? If it's always the first encountered row, then could I

Re: SELECT DISTINCT question

2003-02-27 Thread Frank Peavy
Sheryl, See my comments below... (1) What is the rule that SELECT DISTINCT uses when deciding which of multiple instances to return? Does it return the first one? How it selects the distinct items is outside my area of knowledge. I would not assume it is the first one or the last one, or anywhere

Re: SELECT DISTINCT question

2003-02-27 Thread Sheryl Canter
subselects. - Sheryl - Original Message - From: Sheryl Canter [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 26, 2003 11:49 AM Subject: SELECT DISTINCT question I need help with a query. I have a 'royalties' table that looks like this: AuthorIDProgramID

Re: SELECT DISTINCT question

2003-02-27 Thread Tore Bostrup
26, 2003 11:49 AM Subject: SELECT DISTINCT question I need help with a query. I have a 'royalties' table that looks like this: AuthorIDProgramIDRoyalty -- Author1 Program1 0.15 Author2 Program1 0.10 Author3 Program2

SELECT DISTINCT question

2003-02-26 Thread Sheryl Canter
I need help with a query. I have a 'royalties' table that looks like this: AuthorIDProgramIDRoyalty -- Author1 Program1 0.15 Author2 Program1 0.10 Author3 Program2 0.25 Author4 Program3 0.05 Author5 Program3

Re: SELECT DISTINCT question

2001-02-13 Thread Bob Hall
Say I have a bunch of records in a table with a bunch of fields. One of those fields is cluster_id. It is not unique. However, I want to make a unique set. I want one record for each cluster_id value. I don't care which record that is. Right now, I do: SELECT DISTINCT cluster_id FROM my_table

SELECT DISTINCT question

2001-02-12 Thread Rishi L Khan
Say I have a bunch of records in a table with a bunch of fields. One of those fields is cluster_id. It is not unique. However, I want to make a unique set. I want one record for each cluster_id value. I don't care which record that is. Right now, I do: SELECT DISTINCT cluster_id FROM my_table