Select * FROM Processed WHERE TransactionID IN ( SELECT TOP 1 * FROM Processed WHERE ChannelID = 1 or ChannelID = 2 ) AS tmpTbl

Posts   
 
    
bvalle
User
Posts: 54
Joined: 07-Jun-2006
# Posted on: 18-Jul-2006 15:45:39   

Hello

Could someone point me in the right direction to be able to translate this query to LLBLGen code.

I have a table called Processed, it contains ChannelID, TransactionID and TransactionIndex. The table is keyed by a conjuction of TransactionID and TransactionIndex.

I need to pull a certain ChannelID number and I would like all the repeating transaction IDs for the transactionID that I pull. I know I could do this with two fetches, where the first would pull the first entry and the next fetch would filter on TransactionID and pull my other records, but is there a way to do this with one fetch?

Please let me know.

Thank you, Bruno Valle

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 18-Jul-2006 16:19:18   

Please use a FieldCompareSetPredicate as mentioned in the docs "Using the generated code -> Adapter/ SelfServicing -> filtering and sorting -> the predicate system"

bvalle
User
Posts: 54
Joined: 07-Jun-2006
# Posted on: 18-Jul-2006 16:31:26   

Thank you. simple_smile

I got to say this is the nicest forum I have ever encountered. I could see the response already been RTFM, but you were really nice, you actually pointed out the chapter and everything.

Thank you again. BV