0

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

hakamairi
  • 4,464
  • 4
  • 30
  • 53
shrikanth
  • 179
  • 3
  • 10

1 Answers1

2

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)
Carlos Duque
  • 482
  • 3
  • 7