For stuff like that - SQL Is the way to go.

Mark

On Tue, Sep 22, 2009 at 12:45 PM, Matthew <[email protected]>wrote:

>
> Hi all
>
> I'm trying to work out if I can use the readByQuery() method to
> retrieve a sibling record. So I've got record with PK id 3 and I want
> the next one within his group (18). In normal SQL I'd do something
> like;
> SELECT MIN(id)
> FROM table
> WHERE id < 3
> AND group = 18
>
> The Transfer docs state that you can't use Aggregate Functions which
> rules this option out. So the only other way would be to do;
> SELECT TOP 1 id
> FROM table
> WHERE id < 3
> AND group = 18
> ORDER BY id ASC
>
> The docs don't state if the TOP or LIMIT command can be used. I tried
> it of course and it threw an error so I'm back to using classic SQL to
> get the id then Transfer to get the object for this id. Just thought
> I'd see if I can do it in one hit?
>
> Cheers
> Matthew
> >
>


-- 
E: [email protected]
T: http://www.twitter.com/neurotic
W: www.compoundtheory.com

--~--~---------~--~----~------------~-------~--~----~
Before posting questions to the group please read:
http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer

You received this message because you are subscribed to the Google Groups 
"transfer-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/transfer-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to