Skip to content

Instantly share code, notes, and snippets.

@acwoss
Created February 16, 2017 12:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save acwoss/f25b44083ba4b9786130e79185bdb8a0 to your computer and use it in GitHub Desktop.
Save acwoss/f25b44083ba4b9786130e79185bdb8a0 to your computer and use it in GitHub Desktop.
create table empresas
(
id int,
name varchar(255)
);
create table diretores (
id int,
name varchar(255),
empresa int
);
insert into empresas (id, name) values (1, "empresa_1");
insert into diretores (id, name, empresa) values (1, "diretor_1", 1);
insert into diretores (id, name, empresa) values (2, "diretor_2", 1);
select count(*) from diretores where empresa = 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment