shrikanth
shrikanth

Reputation: 179

Gosu Queries to join two tables

How to join below two tables using gosu .. This is from Contact Manager (GW Training App)

1 ABContact
2 BankAccount

Below SQL can be used to find all account hold by one particluar contact

select b.accountnumber from ABContact a, BankAccount b where
a.id=b.contactid and a.id='123'

Please write the same query in Gosu

Upvotes: 0

Views: 4924

Answers (1)

Carlos Duque
Carlos Duque

Reputation: 512

Query is like this

uses gw.api.database.Query

var account: BankAccount 
var query = Query.make(ABContact).join("ID", BankAccount, "Contact").compare(BankAccount#ID, Equals, account.ID)

Upvotes: 2

Related Questions