SELECT COMMAND

875 views
Skip to first unread message

nam_3220

unread,
Aug 9, 2007, 2:45:02 AM8/9/07
to jBASE
Hi,

I have created a file in jBase called F.ACCOUNT with five field and
there are 100 record totally.

My requirement is to select only those records whose field values are
unique, meaning the value of one field in record1 should be different
from the value of the same field in record2.

Is there any keyword in jBase as in Oracle (sql) ; the Keyword
DISTINCT to avoid the duplicate columns from a table.


Thanks

Daniel Klein

unread,
Aug 9, 2007, 10:07:02 AM8/9/07
to jB...@googlegroups.com


SELECT F.ACCOUNT SAVING UNIQUE fieldname

where 'fieldname' is the name of the column (attribute) that is defined in the DICTionary of F.ACCOUNT.

Dan


Peter Mowatt

unread,
Aug 13, 2007, 11:25:49 PM8/13/07
to jB...@googlegroups.com

Hi.

            From the sound of it, you want to take those 100 records and get rid of any records that have the same value in the same field. At the end, you want a select list of the keys of F.ACOUNT, not the values in the field, right? If not, then you statement below will give you all the unique values from the field and make a list out them. If not, then which records are you going to drop from the list to form your unique list? Some priority or other condition? That being the case, you should be sort-selecting the list by the tested field, by some other priority (item id? Whatever).  I think it would probably be faster to write a program to read in the list and spit one back out ready for the next step than it is to research this.  I can’t think of any other way. Will let you know if I do.

            Peter

naresh kumar

unread,
Aug 22, 2007, 12:56:43 AM8/22/07
to jB...@googlegroups.com
Hi,
 
Thanks Daniel and  Peter for your timely help

 
Reply all
Reply to author
Forward
0 new messages