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

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-10-13 Thread jeffrey_n_Dyke
cc: Subject: SELECT DISTINCT question 10/13/2003

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-03-01 Thread Sheryl Canter
PROTECTED]>; "'Juan Nin'" <[EMAIL PROTECTED]>; <[EMAIL 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 'my

RE: SELECT DISTINCT question

2003-03-01 Thread Uttam
duplicate 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 no

Re: SELECT DISTINCT question

2003-02-28 Thread Sheryl Canter
this correctly? - 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 Ca

Re: SELECT DISTINCT question

2003-02-28 Thread Tore Bostrup
or your 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 D

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

Re: SELECT DISTINCT question

2003-02-28 Thread Sheryl Canter
L PROTECTED]> To: "Sheryl 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 tha

Re: SELECT DISTINCT question

2003-02-28 Thread Sheryl Canter
up so I can identify which author name to display. Thanks for your help. - Sheryl - Original Message - From: "Frank Peavy" <[EMAIL PROTECTED]> To: "Sheryl Canter" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Friday, February 28, 2003 11:22 AM S

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 des

Re: SELECT DISTINCT question

2003-02-28 Thread Tore Bostrup
t: Friday, February 28, 2003 7:58 AM Subject: Re: SELECT DISTINCT question > Tore, > > Thanks very much for this. Question: Is it better to use INNER JOIN than a > WHERE clause (for readability)? They do the same thing, don't they? > > I will try this out as soon as a finish a

Re: SELECT DISTINCT question

2003-02-28 Thread Sheryl Canter
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 quest

Re: SELECT DISTINCT question

2003-02-27 Thread Tore Bostrup
; 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 > -- > Aut

Re: SELECT DISTINCT question

2003-02-27 Thread Sheryl Canter
on this list showed me how a subselect could achieve this result, but MySQL doesn't support subselects. - Sheryl >- Original Message - >From: "Sheryl Canter" <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]> >Sent: Wednesday, February 26, 2003 11:49 A

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 Don Read
On 27-Feb-2003 Sheryl Canter wrote: > > 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

Re: SELECT DISTINCT question

2003-02-27 Thread Sheryl Canter
: Thursday, February 27, 2003 11:10 AM Subject: Re: 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

Re: SELECT DISTINCT question

2003-02-27 Thread Frank Peavy
- 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: AuthorIDProgramIDRoyalty -

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

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_ta

Re: SELECT DISTINCT question

2001-02-12 Thread Thalis A. Kalfigopoulos
> 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 FRO

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 Th