Complex WHERE in Table Compare?

16 views
Skip to first unread message

Joshua

unread,
Jul 23, 2020, 11:28:51 AM7/23/20
to DB Solo
Hi DBSolo team!

I'd like to compare data in a set of tables with a complex SQL predicate. 

Here's the image in your docs that shows how to set up a WHERE predicate. 



The set of WHEREs I'd like to use are significantly more complex than this, and I can't quite understand how they work (or even if they can). 

I'd like to write something in this box like: 

targetTable.addressid = addressTable.addressid and addressTable.userprofileid = profileTable.userprofileid and profileTable.id = [SOME ID]

where "addressTable" and "profileTable" are different tables in the larger DB. Later on, there would probably be joins and more complex predicates.

Is this possible?

Also, I'd like to variable-ize the [SOME ID] portion of my predicate like I can in the query window, something like this: 

Likewise, is this possible?

Thanks!
-- JCB

DB Solo Admin

unread,
Jul 23, 2020, 4:06:55 PM7/23/20
to DB Solo
You cannot use joins directly but a subquery should work. So something like this might work

where addressid in (select a.addressid from addressTable a, profileTable p where a.userprofileid = p.userprofileid and p.id = X)

Marko
Reply all
Reply to author
Forward
0 new messages