main logo
Subject: Re: "walking the db"
Author: Frank Schima
Posted: 2001/04/29 09:08:17
 
View Entire Thread
New Search


--- Ruslan Zasukhin <sunshine /AT/ public D.OT kherson.ua> wrote:
> on 28/4/01 16:20, Totte Alm at totte@code66.se wrote:
> > If I could get a selection/cursor that contained
> > RecID, ID "6 chars", NAME "64 chars", where NAME occurs at least TWO times
> > in the database, that is, there are at least two entries with the same name.
> > Order that by NAME. Then I would only have to walk < 4000 records in a
> > 400.000 record database.
> >
> > So, how to accomplish such a criteria? I know doing that in SQL isnt easy,
> > if possible at all, but Ruslan might know one of two tricks doing this with
> > BaseObject->xxxxx??
>
> you mean that IF you have a table:
>
> 1 ddd
> 2 bbb
> 3 aaa
> 4 ddd
> 5 aaa
> 6 rrr
>
> THEN you must get selection {3, 5, 1, 4} YES ?
>
> I also do not see how this can be formulated in SQL.
> Anybody know ?

I can do it in Sybase with the following SQL:
Select RecID, ID, NAME From MyTable
Where ID in (Select ID From MyTable Group By NAME Having count(*) > 1)
Order By NAME

But Valentina cannot yet do sub-queries, Group By, Having or in.


-Frank


=====
Frank Schima <mailto:macsforever2000 /AT/ yahoo D.OT com>
Yahoo Messenger Chat <macsforever2000>
INADEV Consulting Inc. <http://www.inadev.com/>
Columbia, MD USA <http://columbiamaryland.com/>

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

-------------------------------------------------------------
The Valentina mailing list is brought to you by MacServe.net
For info on lists services, see http://www.macserve.net/lists.html
 
©2001 Frank Schima
<-- Prior Message New Search Next Message -->