mysql - How to search where some data is in table 1 and other data is in table 3 with both having a UUID the same -


i have 3 tables

for instance

salestable -id -variableb -customeruuid -variablec  customertable -customeruuid -contractuuid  contracttable -contractuuid -variabled 

so doing sql query on salestable

like:

select distinct variableb salestable variabled = "blah"; 

how can this? can find contract associated current salestable?

a bit more info

they 1:1 relationship - contracttable tied 1 customertable tied 1 salestable

there lot of data in database thousands of entries - query not run need run efficent.

select  a.*    salestable         inner join customertable b             on a.customeruuid = b.customeruuid         inner join contracttable c             on b.contractuuid = c.contractuuid   c.variabled = 'valuehere' 

to further gain more knowledge joins, kindly visit link below:


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -