mysql - join elements from three unrelated tables -
sql newbie here. have following schema.
i provide list of active primary super charged domains belonging foobar association.
as far know, 3 tables (sites, domain, , name) cannot joined together. how can done?
this example of joining 3 tables
select * companies join sites on sites.company = companies.id join domains on domains.site = sites.id sites.is_supercharged = 1 , sites.is_deleted = 0 , domains.is_primary = 1 , domains.is_deleted = 0
it based on schema (i hope field names correct, text quite small)
when joining table query, need specify matching fields reference in on
part. , can add condition in where
part.
Comments
Post a Comment