How to have distinct based on value of a certain field only? 
Author Message
 How to have distinct based on value of a certain field only?
Spose we have: SELECT DISTINCT field1,field2,field3 FROM some_table
The above would return unique compaund of those three fields. I need the
DESTINCT to watch for values in field 3.

Thanks



Tue, 04 May 2004 17:57:13 GMT
 How to have distinct based on value of a certain field only?

ILiya,

If yiu need the distinct of only the values of field3, then only select
field3

Select distinct field3 ;
    from some_table

ie distinct  == distinct records

Gregory
__________________

| Spose we have: SELECT DISTINCT field1,field2,field3 FROM some_table
| The above would return unique compaund of those three fields. I need the
| DESTINCT to watch for values in field 3.
|
| Thanks
|
|



Tue, 04 May 2004 19:13:35 GMT
 How to have distinct based on value of a certain field only?


Quote:
> ILiya,

> If yiu need the distinct of only the values of field3, then only select
> field3

Nope, I need all or them, that is I need several fields.

Thanks anyways



Tue, 04 May 2004 20:36:53 GMT
 How to have distinct based on value of a certain field only?
Then maybe this will give you what you want

select    field3, ;
            field1, ;
            field2 ;
    from sometable ;
    group by 1,2,3

could you explain a bit more what you're after ?

Gregory
____

|


| > ILiya,
| >
| > If yiu need the distinct of only the values of field3, then only select
| > field3
| >
|
| Nope, I need all or them, that is I need several fields.
|
| Thanks anyways
|
|



Tue, 04 May 2004 21:23:19 GMT
 How to have distinct based on value of a certain field only?
Select Distinct applies to rows not columns, you could use this to get it
the way you want.

--
-------
Sender: John P. Chambers    Business: Discovery Center, Inc.
Hm. Ph. (713) 465-4209       Bus. Ph.: (713) 963-0043
Texas Licenses:                    Fax Ph.: Same - CALL FIRST
  LMSW-ACP,  LMFT,         6024 Fairdale
  LPC, LCDC                         Houston, Texas 77057

Hounix, Inc. (Unix User Group)  Houston, Texas Past President
Virtual FoxPro User Group (VFUG) Public Relations Mgr.


Member HAL-PC BOD and FoxPro SIG Flunky

Solution Group, MS Solution Providers


Quote:



> > ILiya,

> > If yiu need the distinct of only the values of field3, then only select
> > field3

> Nope, I need all or them, that is I need several fields.

> Thanks anyways

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.298 / Virus Database: 161 - Release Date: 11/13/2001


Tue, 04 May 2004 21:43:30 GMT
 
 [ 5 post ] 

 Relevant Pages 

1. Select distinct for certain fields but show all fields

2. Incrementing Next Field's Value Based Upon Prior Field's Value

3. Delete Certain Rows based on field contents

4. Field value base on a radio button value list

5. Updating Field based on value in another field

6. Extracting Distinct Records Based on Two Fields

7. how to assign a default value to a field based on another field

8. Setting default value of field...having problems

9. HOWTO: Declare table field having Default Value - NULL or NOT NULL

10. Non text fields having a text default value

11. How to Insert Distinct Field Value

12. Count occurrences of a dimension having a measure within a certain range


 
Powered by phpBB® Forum Software