Populate select with 2 possible sql statements

I have 2 selects. GroupID and ClientID. After choosing groupID, the clientID populates. The lookup table for clientid has userID, groupID, ClientID. UserID is passed in as a global. So User 2 has 4 entries for the chosen groupID and they can pick from one of 4 clients. But if the entry for ClientID is a 0, that means they can pick from any clients for that group. There isn’t an entry for each in the lookup table. The select needs to go to the clients table and pick every clientID for that GroupID.

I have tried every trick I know. Thoughts on how to have conditional lookup for select?

In the ClientID lookup can’t you just add a WHERE groupID>=1 ?

That will only work for the rows with individual entries. It’s hard to explain like this!
USER-GROUP-CLIENT TABLE (there is more to it, but this is relevant part)
UserID 1
GroupID 12
ClientID 3
UserID 1
GroupID 12
ClientID 4
UserID 2
GroupID 12
ClientID 0

So userID 1 chooses group 12 and clientID populates with 3 and 4.
User ID 2 chooses group 12 and clientID doesn’t populate at all. ClientID 0 means every clientID associated with group 12. There can be many of them. The select needs to see a 0 for clientID and go to the Client table to see how many clients are actually in group 12 and grab all those. Ideally I could do an sc_lookup to see something like max value(clientID) for that user/group. If 0, do the select from the client table. If not, select clients from here. I don’t see ANY way to pull that off.