Hi,
Im am trying to make a query in a many to many relationschip, but there is no way that i can use the IN word in Rollbase as usual in standard SQL.
Can anyone help?
What do you mean by "there is no way that i can use the IN word in Rollbase as usual in standard SQL." ?
I've been able to use the IN operator in rollbase queries such as rbv_api.selectQuery() and rbf_selectQuery() successfully in the past.
Could you elaborate further?
I have a n to n relation between a 'shop' and a 'shopgroup'.
So 1 shop can be a related to 0, 1 or more shopgroups.
Is i use SELECT id FROM shop WHERE R_shop_shopgroup = ?, 0, 100, 'shopgroupid' then the result is that i get the id's of the shop that ONLY have that specific shopgroupid. So when the shop ia also related to a second group that shop will not be shown, although the shop is also related to the 'shopgroupid'
Have you tried:
SELECT id FROM shop WHERE R_shop_shopgroup IN (shopgroupid), 0, 100
Also, I think it would be much easier to use rbv_api.getRelatedIds() or rbv_api.getRelatedIds2() to get shops for your case. It would lessen your processing time as you don't have to perform the query on the whole table but just get the specific data stored on the current record you are on.
Hope this helps
|
Hello,
I tried your suggestion and it works well when i use rbv_api.getRelatedIds().
Thank you very much!
Regards, Wim