<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4036429675738629295</id><updated>2024-10-04T23:00:49.468-03:00</updated><category term="MySQL"/><category term="SQL Server"/><category term="Oracle"/><category term="Select"/><category term="SQL"/><category term="Operador Relacional"/><category term="join"/><category term="Modelo Relacional"/><category term="Normalização"/><category term="Operador Lógico"/><category term="SQLite"/><category term="1FN"/><category term="Distinct"/><category term="Insert"/><category term="Left Join"/><category term="Microsoft"/><category term="PL/SQL"/><category term="and"/><category term="or"/><category term="tipos de joins"/><category term="2FN"/><category term="DB2"/><category term="Delete"/><category term="Inner Join"/><category term="Left Outer Join"/><category term="MIN"/><category term="Order by"/><category term="Right Join"/><category term="Right Outer Join"/><category term="SGDB"/><category term="Transact-SQL"/><category term="Update"/><category term="banco de dados"/><category term="in"/><category term="teoria dos conjuntos"/><category term="where"/><category term="3FN"/><category term="AVG"/><category term="COUNT"/><category term="Create table"/><category term="Edgar Frank Codd"/><category term="Firebird"/><category term="Full Join"/><category term="Full Outer Join"/><category term="Group by"/><category term="Instalando"/><category term="Introdução"/><category term="LIKE"/><category term="Livro"/><category term="MAX"/><category term="Mangá"/><category term="Manipulando Dados"/><category term="NULL"/><category term="Operador Aritimético"/><category term="Operador Matemático"/><category term="PostgreSQL"/><category term="SUM"/><category term="Subquery"/><category term="Union"/><category term="between"/><category term="condição"/><category term="download"/><category term="etc."/><category term="from"/><category term="not"/><category term="objetivo"/><category term="on"/><category term="relação"/><title type='text'>Aprendendo SQL</title><subtitle type='html'>O objetivo deste blog é passar informações sobre linguagem SQL e assuntos relacionados ao tema, independente do SGBD  - MySQL, SQLite, Oracle, SQL Server, etc.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://sqlaprendendo.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://sqlaprendendo.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>28</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4036429675738629295.post-7556302671487489115</id><published>2013-12-15T12:53:00.002-02:00</published><updated>2013-12-15T12:53:47.056-02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="in"/><category scheme="http://www.blogger.com/atom/ns#" term="join"/><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft"/><category scheme="http://www.blogger.com/atom/ns#" term="MIN"/><category scheme="http://www.blogger.com/atom/ns#" term="MySQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Operador Relacional"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle"/><category scheme="http://www.blogger.com/atom/ns#" term="Select"/><category scheme="http://www.blogger.com/atom/ns#" term="Subquery"/><category scheme="http://www.blogger.com/atom/ns#" term="where"/><title type='text'>Select - Subquerys</title><content type='html'>Faz algum tempo que não escrevo nada. Hoje vamos falar sobre &lt;b&gt;Subquerys&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Uma &lt;b&gt;Subquery &lt;/b&gt;nada mais é do que uma comando &lt;b&gt;Select &lt;/b&gt;dentro de outro comando &lt;b&gt;Select&lt;/b&gt;.&lt;br /&gt;
_________________________________________________________________________________&lt;br /&gt;
&lt;b style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;Exemplos&lt;/b&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot; /&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;Para os exemplos a seguir vamos utilizar as tabelas Funcionario e Departamento criadas no post&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/tabelas-para-nossos-exemplos.html&quot; style=&quot;background-color: white; color: #888888; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px; text-decoration: none;&quot;&gt;Tabelas para nossos exemplos&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: #3d85c6;&quot;&gt;
&lt;b&gt;1. Utilizando Subquery em cláusulas Where&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Select&lt;br /&gt;
&amp;nbsp;IdFuncionario,Nome,IdDepto&lt;br /&gt;
From&lt;br /&gt;
&amp;nbsp;Funcionario&lt;br /&gt;
Where IdDepto in (Select IdDepto from Departamento Where NomeDepto like &#39;c%&#39;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdFuncionario&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Nome&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdDepto&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;2&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Pedro Silva&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;6&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Daniel Borges&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;6&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;7&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Diana Cristina&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;7&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;8&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Miriam Lagos&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;10&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Paula Silva&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
Neste exemplo utilizamos uma &lt;b&gt;Subquery &lt;/b&gt;para selecionar funcionários que possuem departamentos que iniciam com a letra &quot;C&quot;.&lt;br /&gt;
&lt;br /&gt;
Conseguiríamos obter o mesmo resultado utilizando &lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/06/joins-parte-1-inner-join.html&quot; target=&quot;_blank&quot;&gt;Join&lt;/a&gt; maneira:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Select&lt;br /&gt;
&amp;nbsp;a.IdFuncionario,a.Nome,a.IdDepto&lt;br /&gt;
From&lt;br /&gt;
&amp;nbsp;test.Funcionario a&lt;br /&gt;
Inner Join test.Departamento b On (b.IdDepto = a.IdDepto)&lt;br /&gt;
Where&lt;br /&gt;
&amp;nbsp;NomeDepto like &#39;c%&#39;&lt;br /&gt;
_________________________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: #3d85c6;&quot;&gt;
&lt;b&gt;2. Mais um exemplo de Subquery utilizando a cláusula Where:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
Select&lt;br /&gt;
&amp;nbsp;IdFuncionario,Nome,IdDepto&lt;br /&gt;
From&lt;br /&gt;
&amp;nbsp;Funcionario&lt;br /&gt;
Where IdDepto in (Select Min(IdDepto) From Departamento);&lt;br /&gt;
&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdFuncionario&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Nome&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdDepto&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Joaquim José&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;9&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;José Maria&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
Neste exemplo selecionamos os funcionários com o Menor código de Departamento. &lt;br /&gt;
_________________________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: #3d85c6;&quot;&gt;
&lt;b&gt;3. Utilizando uma Subquery em uma coluna:&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
Select&lt;br /&gt;
&amp;nbsp;a.IdDepto, &lt;br /&gt;
&amp;nbsp;a.NomeDepto,&lt;br /&gt;
&amp;nbsp;(Select Min(f.Nome) From Funcionario f Where f.IdDepto=a.IdDepto ) as Primeiro_Funcionario &lt;br /&gt;
From&lt;br /&gt;
&amp;nbsp;Departamento a&lt;br /&gt;
&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdDepto&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;NomeDepto&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Primeiro_Funcionario&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Administração&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Joaquim José&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;2&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Contabilidade&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Paula Silva&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;TI&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Mário Mattos&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;4&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Almoxarifado&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Josefa Cristina&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Segurança&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Carla Maria&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;6&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Controladoria&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Daniel Borges&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;7&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Compras&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Diana Cristina&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;8&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Contas a Pagar&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Miriam Lagos&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;20&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Estoque&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;21&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Marketing&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;22&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Contas a Receber&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;23&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Contas a Pagar&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;25&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Produção&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;26&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Operacional&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;27&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Juridico&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;28&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Vendas&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
Nesta consulta utilizamos uma Subquery para coluna calculada &quot;Primeiro_Funcionario&quot;, está coluna mostrará o primeiro funcionário de cada departamento. Verifique para que os Departamentos que não possuem funcionários temos o valor NULL como resultado.&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: #3d85c6;&quot;&gt;
&lt;b&gt;Observações:&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Nos exemplos as Querys mais internas são executadas&amp;nbsp; primeiro, a seguir as Querys principais são executadas.&lt;br /&gt;
&lt;br /&gt;
Também podemos verificar que as Querys mais internas retornam um único valor. Neste caso poderíamos utilizar os &lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-2.html&quot; target=&quot;_blank&quot;&gt;operadores relacionais&lt;/a&gt; : “ = , &amp;lt; , &amp;gt; , &amp;gt;= , etc. “, ao invés do operador &lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-4.html&quot; target=&quot;_blank&quot;&gt;IN&lt;/a&gt;. O operador &lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-4.html&quot; target=&quot;_blank&quot;&gt;IN&lt;/a&gt; é indicado para quando temos mais de um resultado nas Querys mais internas.&lt;br /&gt;&lt;br /&gt;
_________________________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Veja também&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/06/joins-parte-1-inner-join.html&quot;&gt;Joins - Parte 1 (Inner Join)&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/06/joins-parte-2-left-join.html&quot;&gt;Joins - Parte 2 (Left Join)&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/06/joins-parte-3-right-join.html&quot;&gt;Joins - Parte 3 (Right Join)&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/manipulando-dados-insert.html&quot; target=&quot;_blank&quot;&gt;Manipulando Dados - INSERT&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/manipulando-dados-update.html&quot; target=&quot;_blank&quot;&gt;Manipulando Dados - UPDATE&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/manipulando-dados-delete.html&quot; target=&quot;_blank&quot;&gt;Manipulando Dados - DELETE&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-1.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 1&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-2.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 2&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-3.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 3&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-4.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 4&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-5.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 5&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-6.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 6&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-7.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 7&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-8.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 8&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-utilizando-clausula-union.html&quot; target=&quot;_blank&quot;&gt;Select - Utilizando a cláusula UNION&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-agrupando-dados.html&quot;&gt;Select - Agrupando Dados&lt;/a&gt;&lt;br /&gt;
&lt;br class=&quot;Apple-interchange-newline&quot; /&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlaprendendo.blogspot.com/feeds/7556302671487489115/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://sqlaprendendo.blogspot.com/2013/12/select-subquerys.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/7556302671487489115'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/7556302671487489115'/><link rel='alternate' type='text/html' href='http://sqlaprendendo.blogspot.com/2013/12/select-subquerys.html' title='Select - Subquerys'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4036429675738629295.post-2057081858730746411</id><published>2013-12-14T13:16:00.003-02:00</published><updated>2013-12-14T13:16:21.807-02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="banco de dados"/><category scheme="http://www.blogger.com/atom/ns#" term="Insert"/><category scheme="http://www.blogger.com/atom/ns#" term="Left Join"/><category scheme="http://www.blogger.com/atom/ns#" term="Livro"/><category scheme="http://www.blogger.com/atom/ns#" term="Mangá"/><category scheme="http://www.blogger.com/atom/ns#" term="MySQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Normalização"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle"/><category scheme="http://www.blogger.com/atom/ns#" term="Select"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><category scheme="http://www.blogger.com/atom/ns#" term="Update"/><title type='text'>Dica de Livro</title><content type='html'>&lt;br /&gt;
Achei o livro &lt;a href=&quot;http://www.novatec.com.br/livros/mangabd/capitulo9788575221631.pdf&quot; target=&quot;_blank&quot;&gt;Guia Mangá De Banco de Dados&lt;/a&gt; bem legal.&lt;br /&gt;
&lt;br /&gt;
O livro fala sobre vários conceitos básicos de &lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/04/links-de-para-alguns-sgdbs.html&quot; target=&quot;_blank&quot;&gt;Bancos de Dados&lt;/a&gt;, &lt;a href=&quot;http://pt.wikipedia.org/wiki/Modelo_de_entidade_e_relacionamento&quot; target=&quot;_blank&quot;&gt;E-R&lt;/a&gt;, &lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/normalizacao-de-dados-parte-1.html&quot; target=&quot;_blank&quot;&gt;Normalização&lt;/a&gt;, &lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-1.html&quot; target=&quot;_blank&quot;&gt;Linguagem SQL&lt;/a&gt;, &lt;span id=&quot;goog_863784950&quot;&gt;&lt;/span&gt;&lt;a href=&quot;https://www.blogger.com/&quot;&gt;Transações&lt;span id=&quot;goog_863784951&quot;&gt;&lt;/span&gt;&lt;/a&gt; e Bancos de Dados Distribuídos - tudo isso em &lt;a href=&quot;http://pt.wikipedia.org/wiki/Mang%C3%A1&quot; target=&quot;_blank&quot;&gt;Mangá&lt;/a&gt;, isso mesmo, o livro usa a linguagem dos quadrinhos para falar sobre Bancos de Dados.&lt;br /&gt;
&lt;br /&gt;
O livro pode ser utilizado como material pedagógico. Os assuntos não são tratados de maneira profunda, o ponto forte do livro é a utilização da linguagem dinâmica dos quadrinhos para tornar um assunto pesado mais interessante, e despertar o interesse do público com espírito jovem.&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlaprendendo.blogspot.com/feeds/2057081858730746411/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://sqlaprendendo.blogspot.com/2013/12/dica-de-livro.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/2057081858730746411'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/2057081858730746411'/><link rel='alternate' type='text/html' href='http://sqlaprendendo.blogspot.com/2013/12/dica-de-livro.html' title='Dica de Livro'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4036429675738629295.post-6070535073058387390</id><published>2012-07-07T14:04:00.002-03:00</published><updated>2012-07-07T14:04:25.044-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Full Join"/><category scheme="http://www.blogger.com/atom/ns#" term="Full Outer Join"/><category scheme="http://www.blogger.com/atom/ns#" term="Inner Join"/><category scheme="http://www.blogger.com/atom/ns#" term="join"/><category scheme="http://www.blogger.com/atom/ns#" term="Left Join"/><category scheme="http://www.blogger.com/atom/ns#" term="Left Outer Join"/><category scheme="http://www.blogger.com/atom/ns#" term="MySQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Right Join"/><category scheme="http://www.blogger.com/atom/ns#" term="Right Outer Join"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><category scheme="http://www.blogger.com/atom/ns#" term="teoria dos conjuntos"/><title type='text'>Joins - Parte 4 (Full Join)</title><content type='html'>Continuando nossa série de posts sobre &lt;b&gt;Joins &lt;/b&gt;neste post falaremos sobre &lt;b&gt;Full Join&lt;/b&gt;.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;O diagrama abaixo mostra o que é um &lt;b&gt;Full Join&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipJVJzOwcPlJNo6bjwFZuYpGO3GP3iafrXrVCqzgonmGn_2iFq8NeZzJph5Yt63aGL16VP4FzUhZBFzq0wnM_Jc-_iKGgUucYBlQqQxqS5fqkhsKgGPtsg7G6aoYWhSbrFKtKR37gPwVqx/s1600/Full_Join.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;145&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipJVJzOwcPlJNo6bjwFZuYpGO3GP3iafrXrVCqzgonmGn_2iFq8NeZzJph5Yt63aGL16VP4FzUhZBFzq0wnM_Jc-_iKGgUucYBlQqQxqS5fqkhsKgGPtsg7G6aoYWhSbrFKtKR37gPwVqx/s200/Full_Join.jpg&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Analisando a figura acima podemos dizer que uma junção do tipo &lt;b&gt;Full Join&lt;/b&gt; é o soma dos dois conjuntos. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Sintaxe&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Full [Outer] Join&lt;/b&gt; &lt;i&gt;tabela&lt;/i&gt;&lt;b&gt; | &lt;/b&gt;&lt;i&gt;view&lt;/i&gt;&lt;b&gt; On &lt;/b&gt;&lt;i&gt;condição &lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;tabela | view &lt;/i&gt;- tabela ou view que será relacionada no &lt;b&gt;Full Join&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;On &lt;/b&gt;- cláusula onde a condição será especificada.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;condição &lt;/i&gt;- condição que define o &lt;b&gt;Full Join&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;OBSERVAÇÃO&lt;/b&gt; &lt;br /&gt;
&lt;br /&gt;
Esta sintaxe funciona com o SQL Server. Nos exemplos também iremos simular isto no MySQL.&lt;br /&gt;
____________________________________________________________________________________&lt;br /&gt;
&lt;b&gt;Exemplos&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Para os exemplos a seguir vamos utilizar as tabelas Funcionario e Departamento criadas no post &lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/tabelas-para-nossos-exemplos.html&quot;&gt;Tabelas para nossos exemplos&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b style=&quot;color: #3d85c6;&quot;&gt;Conteúdo parcial tabela Funcionario&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/b&gt;&lt;b style=&quot;color: #3d85c6;&quot;&gt;Tabela Departamento&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 496px;&quot;&gt;&lt;colgroup&gt;&lt;col style=&quot;mso-width-alt: 2925; mso-width-source: userset; width: 60pt;&quot; width=&quot;80&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 3840; mso-width-source: userset; width: 79pt;&quot; width=&quot;105&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 2377; mso-width-source: userset; width: 49pt;&quot; width=&quot;65&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 3401; mso-width-source: userset; width: 70pt;&quot; width=&quot;93&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 1865; mso-width-source: userset; width: 38pt;&quot; width=&quot;51&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 3730; mso-width-source: userset; width: 77pt;&quot; width=&quot;102&quot;&gt;&lt;/col&gt;
 &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td class=&quot;xl66&quot; height=&quot;20&quot; style=&quot;background: silver; border: .5pt solid black; color: white; font-family: Calibri; font-size: 10.0pt; font-weight: 700; height: 15.0pt; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;IdFuncionario&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background: silver; border-left: none; border: .5pt solid black; color: white; font-family: Calibri; font-size: 10.0pt; font-weight: 700; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Nome&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background: silver; border-left: none; border: .5pt solid black; color: white; font-family: Calibri; font-size: 10.0pt; font-weight: 700; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;IdDepto&lt;/td&gt;
  &lt;td style=&quot;width: 70pt;&quot; width=&quot;93&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; style=&quot;background: silver; border: .5pt solid black; color: white; font-family: Calibri; font-size: 10.0pt; font-weight: 700; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;IdDepto&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background: silver; border-left: none; border: .5pt solid black; color: white; font-family: Calibri; font-size: 10.0pt; font-weight: 700; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 77pt;&quot; width=&quot;102&quot;&gt;NomeDepto&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;1&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Joaquim José&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;1&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;1&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 77pt;&quot; width=&quot;102&quot;&gt;Administração&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;2&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Pedro Silva&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;2&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;2&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 77pt;&quot; width=&quot;102&quot;&gt;Contabilidade&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;3&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Mário Mattos&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;3&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;3&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 77pt;&quot; width=&quot;102&quot;&gt;TI&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;4&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Manuel Antônio&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;4&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;4&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 77pt;&quot; width=&quot;102&quot;&gt;Almoxarifado&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;5&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Maria Aparecida&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;5&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;5&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 77pt;&quot; width=&quot;102&quot;&gt;Segurança&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;6&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Daniel Borges&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;6&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;6&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 77pt;&quot; width=&quot;102&quot;&gt;Controladoria&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;7&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Diana Cristina&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;7&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;7&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 77pt;&quot; width=&quot;102&quot;&gt;Compras&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;8&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Miriam Lagos&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;8&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;8&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 77pt;&quot; width=&quot;102&quot;&gt;Contas a Pagar&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;9&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;José Maria&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;1&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;20&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 77pt;&quot; width=&quot;102&quot;&gt;Estoque&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;10&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Paula Silva&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;2&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;21&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 77pt;&quot; width=&quot;102&quot;&gt;Marketing&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;11&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Vanderlei Santos&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;3&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;22&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 77pt;&quot; width=&quot;102&quot;&gt;Contas a Receber&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;12&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Josefa Cristina&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;4&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;23&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 77pt;&quot; width=&quot;102&quot;&gt;Contas a Pagar&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;13&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Carla Maria&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;5&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;25&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 77pt;&quot; width=&quot;102&quot;&gt;Produção&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;14&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Alex Fabri&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;12&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;26&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 77pt;&quot; width=&quot;102&quot;&gt;Operacional&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;16&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Miguel Angelo&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;16&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;27&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 77pt;&quot; width=&quot;102&quot;&gt;Juridico&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;15&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Vanessa Silva&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;15&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl69&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;28&lt;/td&gt;
  &lt;td class=&quot;xl71&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 77pt;&quot; width=&quot;102&quot;&gt;Vendas&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl69&quot; height=&quot;20&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;17&lt;/td&gt;
  &lt;td class=&quot;xl70&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Fernando Silveira&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl71&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;19&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
___________________________________________________________________________________ &lt;br /&gt;
&lt;div style=&quot;color: #3d85c6;&quot;&gt;
&lt;b&gt;1. Exemplo de Full Join (SQL Server)&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
Select &lt;br /&gt;
&amp;nbsp; f.IdFuncionario, f.Nome, d.IdDepto, d.NomeDepto &lt;br /&gt;
From &lt;br /&gt;
&amp;nbsp; Funcionario f&lt;br /&gt;
Full Join Departamento d&amp;nbsp; On (d.IdDepto = f.IdDepto);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdFuncionario&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Nome&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdDepto&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;NomeDepto&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Joaquim José&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Administração&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;2&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Pedro Silva&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;2&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Contabilidade&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Mário Mattos&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;TI&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;4&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Manuel Antônio&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;4&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Almoxarifado&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Maria Aparecida&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Segurança&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;6&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Daniel Borges&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;6&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Controladoria&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;7&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Diana Cristina&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;7&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Compras&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;8&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Miriam Lagos&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;8&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Contas a Pagar&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;9&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;José Maria&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Administração&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;10&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Paula Silva&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;2&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Contabilidade&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;11&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Vanderlei Santos&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;TI&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;12&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Josefa Cristina&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;4&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Almoxarifado&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;13&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Carla Maria&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Segurança&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;14&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Alex Fabri&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;16&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Miguel Angelo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;15&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Vanessa Silva&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;17&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Fernando Silveira&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;20&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Estoque&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;21&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Marketing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;22&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Contas a Receber&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;23&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Contas a Pagar&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;25&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Produção&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;26&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Operacional&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;27&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Juridico&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;28&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Vendas&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
___________________________________________________________________________________ &lt;br /&gt;
&lt;div style=&quot;color: #3d85c6;&quot;&gt;
&lt;b&gt;2. Simulando Full Join no MySQL&lt;/b&gt;&lt;br /&gt;
&lt;/div&gt;
Select &lt;br /&gt;&amp;nbsp; f.IdFuncionario, f.Nome, d.IdDepto, d.NomeDepto &lt;br /&gt;From &lt;br /&gt;&amp;nbsp; Funcionario f&lt;br /&gt;Left Join Departamento d&amp;nbsp; On (d.IdDepto = f.IdDepto)&lt;br /&gt;Union&lt;br /&gt;Select &lt;br /&gt;&amp;nbsp; f.IdFuncionario, f.Nome, d.IdDepto, d.NomeDepto &lt;br /&gt;From &lt;br /&gt;&amp;nbsp; Funcionario f&lt;br /&gt;Right Join Departamento d&amp;nbsp; On (d.IdDepto = f.IdDepto);&lt;br /&gt;&lt;br /&gt;Repare que no exemplo para o MySQL utilizamos dois comandos &lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-1.html&quot;&gt;Select&lt;/a&gt;, um utilizando &lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/06/joins-parte-2-left-join.html&quot;&gt;Left Join&lt;/a&gt; e outro utilizando &lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/06/joins-parte-3-right-join.html&quot;&gt;Right Join&lt;/a&gt;. Para criar um resultado único usamos a cláusula &lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-utilizando-clausula-union.html&quot;&gt;Union&lt;/a&gt;.&lt;br /&gt;
___________________________________________________________________________________ Por enquanto é só pessoal.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Veja também&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/06/joins-parte-1-inner-join.html&quot;&gt;Joins - Parte 1 (Inner Join)&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/06/joins-parte-2-left-join.html&quot;&gt;Joins - Parte 2 (Left Join)&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/06/joins-parte-3-right-join.html&quot;&gt;Joins - Parte 3 (Right Join)&lt;/a&gt;&amp;nbsp; &lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/manipulando-dados-insert.html&quot; target=&quot;_blank&quot;&gt;Manipulando Dados - INSERT&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/manipulando-dados-update.html&quot; target=&quot;_blank&quot;&gt;Manipulando Dados - UPDATE&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/manipulando-dados-delete.html&quot; target=&quot;_blank&quot;&gt;Manipulando Dados - DELETE&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-1.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 1&lt;/a&gt; &lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-2.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 2&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-3.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 3&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-4.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 4&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-5.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 5&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-6.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 6&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-7.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 7&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-8.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 8&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-utilizando-clausula-union.html&quot; target=&quot;_blank&quot;&gt;Select - Utilizando a cláusula UNION&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-agrupando-dados.html&quot;&gt;Select - Agrupando Dados&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlaprendendo.blogspot.com/feeds/6070535073058387390/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/07/joins-parte-4-full-join.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/6070535073058387390'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/6070535073058387390'/><link rel='alternate' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/07/joins-parte-4-full-join.html' title='Joins - Parte 4 (Full Join)'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipJVJzOwcPlJNo6bjwFZuYpGO3GP3iafrXrVCqzgonmGn_2iFq8NeZzJph5Yt63aGL16VP4FzUhZBFzq0wnM_Jc-_iKGgUucYBlQqQxqS5fqkhsKgGPtsg7G6aoYWhSbrFKtKR37gPwVqx/s72-c/Full_Join.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4036429675738629295.post-5228891788474506977</id><published>2012-06-08T16:17:00.001-03:00</published><updated>2012-06-08T16:34:22.758-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="join"/><category scheme="http://www.blogger.com/atom/ns#" term="MySQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Right Join"/><category scheme="http://www.blogger.com/atom/ns#" term="Right Outer Join"/><category scheme="http://www.blogger.com/atom/ns#" term="Select"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><category scheme="http://www.blogger.com/atom/ns#" term="tipos de joins"/><title type='text'>Joins - Parte 3 (Right Join)</title><content type='html'>Continuando nossa série de posts sobre &lt;b&gt;Joins &lt;/b&gt;neste post falaremos sobre &lt;b&gt;Right Join&lt;/b&gt;.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;O diagrama abaixo mostra o que é um &lt;b&gt;Right Join&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRYuEtllyuW28ntO52k9iPUA8e8uLx4NTTUrhUFAX-bzfhrxxxEo0G-bIXYCd5VEQy6QBFTTzsKVTruGIkEd7zt1947dF1CpxM87j6fFDmEirVoW08mdLTlq8IqxQtTOSw2BD7QVDRoDPU/s1600/Right_Join.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;114&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRYuEtllyuW28ntO52k9iPUA8e8uLx4NTTUrhUFAX-bzfhrxxxEo0G-bIXYCd5VEQy6QBFTTzsKVTruGIkEd7zt1947dF1CpxM87j6fFDmEirVoW08mdLTlq8IqxQtTOSw2BD7QVDRoDPU/s640/Right_Join.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Analisando as figuras acima podemos dizer que uma junção do tipo &lt;b&gt;Right Join&lt;/b&gt;
 nada mais é do que o total do conjunto à direita. Independente de 
existir, ou não, um item correspondente no conjunto da esquerda. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Sintaxe&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Right [Outer] Join&lt;/b&gt; &lt;i&gt;tabela&lt;/i&gt;&lt;b&gt; | &lt;/b&gt;&lt;i&gt;view&lt;/i&gt;&lt;b&gt; On &lt;/b&gt;&lt;i&gt;condição &lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;tabela | view &lt;/i&gt;- tabela ou view que será relacionada no &lt;b&gt;Right Join&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;On &lt;/b&gt;- cláusula onde a condição será especificada.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;condição &lt;/i&gt;- condição que define o &lt;b&gt;Right Join&lt;/b&gt;.&lt;br /&gt;
____________________________________________________________________________________&lt;br /&gt;
&lt;b&gt;Exemplos&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Para os exemplos a seguir vamos utilizar as tabelas Funcionario e Departamento criadas no post &lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/tabelas-para-nossos-exemplos.html&quot;&gt;Tabelas para nossos exemplos&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b style=&quot;color: #3d85c6;&quot;&gt;Conteúdo parcial tabela Funcionario&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/b&gt;&lt;b style=&quot;color: #3d85c6;&quot;&gt;Tabela Departamento&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 496px;&quot;&gt;&lt;colgroup&gt;&lt;col style=&quot;mso-width-alt: 2925; mso-width-source: userset; width: 60pt;&quot; width=&quot;80&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 3840; mso-width-source: userset; width: 79pt;&quot; width=&quot;105&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 2377; mso-width-source: userset; width: 49pt;&quot; width=&quot;65&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 3401; mso-width-source: userset; width: 70pt;&quot; width=&quot;93&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 1865; mso-width-source: userset; width: 38pt;&quot; width=&quot;51&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 3730; mso-width-source: userset; width: 77pt;&quot; width=&quot;102&quot;&gt;&lt;/col&gt;
 &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td class=&quot;xl66&quot; height=&quot;20&quot; style=&quot;background: silver; border: .5pt solid black; color: white; font-family: Calibri; font-size: 10.0pt; font-weight: 700; height: 15.0pt; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;IdFuncionario&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background: silver; border-left: none; border: .5pt solid black; color: white; font-family: Calibri; font-size: 10.0pt; font-weight: 700; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Nome&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background: silver; border-left: none; border: .5pt solid black; color: white; font-family: Calibri; font-size: 10.0pt; font-weight: 700; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;IdDepto&lt;/td&gt;
  &lt;td style=&quot;width: 70pt;&quot; width=&quot;93&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; style=&quot;background: silver; border: .5pt solid black; color: white; font-family: Calibri; font-size: 10.0pt; font-weight: 700; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;IdDepto&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background: silver; border-left: none; border: .5pt solid black; color: white; font-family: Calibri; font-size: 10.0pt; font-weight: 700; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 77pt;&quot; width=&quot;102&quot;&gt;NomeDepto&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;1&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Joaquim José&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;1&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;1&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 77pt;&quot; width=&quot;102&quot;&gt;Administração&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;2&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Pedro Silva&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;2&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;2&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 77pt;&quot; width=&quot;102&quot;&gt;Contabilidade&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;3&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Mário Mattos&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;3&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;3&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 77pt;&quot; width=&quot;102&quot;&gt;TI&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;4&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Manuel Antônio&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;4&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;4&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 77pt;&quot; width=&quot;102&quot;&gt;Almoxarifado&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;5&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Maria Aparecida&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;5&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;5&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 77pt;&quot; width=&quot;102&quot;&gt;Segurança&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;6&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Daniel Borges&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;6&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;6&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 77pt;&quot; width=&quot;102&quot;&gt;Controladoria&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;7&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Diana Cristina&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;7&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;7&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 77pt;&quot; width=&quot;102&quot;&gt;Compras&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;8&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Miriam Lagos&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;8&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;8&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 77pt;&quot; width=&quot;102&quot;&gt;Contas a Pagar&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;9&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;José Maria&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;1&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;20&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 77pt;&quot; width=&quot;102&quot;&gt;Estoque&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;10&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Paula Silva&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;2&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;21&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 77pt;&quot; width=&quot;102&quot;&gt;Marketing&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;11&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Vanderlei Santos&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;3&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;22&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 77pt;&quot; width=&quot;102&quot;&gt;Contas a Receber&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;12&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Josefa Cristina&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;4&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;23&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 77pt;&quot; width=&quot;102&quot;&gt;Contas a Pagar&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;13&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Carla Maria&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;5&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;25&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 77pt;&quot; width=&quot;102&quot;&gt;Produção&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;14&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Alex Fabri&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;12&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;26&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 77pt;&quot; width=&quot;102&quot;&gt;Operacional&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;16&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Miguel Angelo&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;16&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;27&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 77pt;&quot; width=&quot;102&quot;&gt;Juridico&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;15&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Vanessa Silva&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;15&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl69&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;28&lt;/td&gt;
  &lt;td class=&quot;xl71&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 77pt;&quot; width=&quot;102&quot;&gt;Vendas&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl69&quot; height=&quot;20&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;17&lt;/td&gt;
  &lt;td class=&quot;xl70&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Fernando Silveira&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl71&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;19&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
___________________________________________________________________________________ &lt;br /&gt;
&lt;div style=&quot;color: #3d85c6;&quot;&gt;
&lt;b&gt;1. Exemplo de Right Join&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjo75OvzN4pvuDqTrNgr6xyTJR3AFKynANQnQ_DFG2fG7S7V0T0-yPZKmkKTBuR_-QwlqAjGymHGD2RtA93w90q5zMLiDxbbNOQFmFVAaAd-x81DTbBFtKfhHGpaxPlyh_R58BJKunvAr_O/s1600/Right_Join_2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;145&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjo75OvzN4pvuDqTrNgr6xyTJR3AFKynANQnQ_DFG2fG7S7V0T0-yPZKmkKTBuR_-QwlqAjGymHGD2RtA93w90q5zMLiDxbbNOQFmFVAaAd-x81DTbBFtKfhHGpaxPlyh_R58BJKunvAr_O/s200/Right_Join_2.jpg&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Select &lt;br /&gt;
&amp;nbsp; f.IdFuncionario, f.Nome, d.IdDepto, d.NomeDepto &lt;br /&gt;
From &lt;br /&gt;
&amp;nbsp; Funcionario f&lt;br /&gt;
Right Join Departamento d On (d.IdDepto = f.IdDepto);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdFuncionario&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Nome&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdDepto&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;NomeDepto&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Joaquim José&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Administração&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;9&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;José Maria&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Administração&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;2&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Pedro Silva&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;2&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Contabilidade&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;10&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Paula Silva&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;2&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Contabilidade&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Mário Mattos&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;TI&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;11&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Vanderlei Santos&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;TI&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;4&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Manuel Antônio&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;4&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Almoxarifado&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;12&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Josefa Cristina&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;4&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Almoxarifado&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Maria Aparecida&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Segurança&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;13&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Carla Maria&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Segurança&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;6&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Daniel Borges&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;6&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Controladoria&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;7&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Diana Cristina&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;7&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Compras&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;8&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Miriam Lagos&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;8&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Contas a Pagar&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;20&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Estoque&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;21&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Marketing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;22&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Contas a Receber&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;23&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Contas a Pagar&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;25&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Produção&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;26&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Operacional&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;27&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Juridico&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;28&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Vendas&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
Repare que todas as linhas da tabela Departamento foram selecionadas, 
mesmo as que não possuem um IdDepto correspondente na tabela Funcionario , para estas linhas as colunas IdFuncionario e Nome são 
mostradas com valor &lt;a href=&quot;http://pt.wikipedia.org/wiki/Null_%28SQL%29&quot;&gt;NULL&lt;/a&gt;. Porém, &lt;a href=&quot;http://pt.wikipedia.org/wiki/Null_%28SQL%29&quot;&gt;NULL&lt;/a&gt; não é bem o que podemos chamar de valor, &lt;a href=&quot;http://pt.wikipedia.org/wiki/Null_%28SQL%29&quot;&gt;NULL&lt;/a&gt; seria na realidade a ausência de valor.&lt;br /&gt;
___________________________________________________________________________________ &lt;br /&gt;
&lt;div style=&quot;color: #3d85c6;&quot;&gt;
&lt;b&gt;2. Usando Right Join para selecionar as linhas da tabela Departamento que não possuem correspondente na tabela Funcionario&lt;/b&gt;&lt;/div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhK8S394zM2rw24b9Z31dBMl7y4xrAV2sbgPeSnhPE-4J6JWErRtDggj8XMqw0tS9qKOz58z7dzK2XSvO3VT3AAOVlNbvi0Ld4kjCbmktaHNqE6ZJ275O2gmQ6EHbL1wDzL7pvkPKil2pQ3/s1600/B-A.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;146&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhK8S394zM2rw24b9Z31dBMl7y4xrAV2sbgPeSnhPE-4J6JWErRtDggj8XMqw0tS9qKOz58z7dzK2XSvO3VT3AAOVlNbvi0Ld4kjCbmktaHNqE6ZJ275O2gmQ6EHbL1wDzL7pvkPKil2pQ3/s200/B-A.jpg&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Select &lt;br /&gt;
&amp;nbsp; f.IdFuncionario, f.Nome, d.IdDepto, d.NomeDepto &lt;br /&gt;
From &lt;br /&gt;
&amp;nbsp; Funcionario f&lt;br /&gt;
Right Join Departamento d On (d.IdDepto = f.IdDepto)&lt;br /&gt;
Where f.Nome is NULL;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdFuncionario&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Nome&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdDepto&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;NomeDepto&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;20&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Estoque&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;21&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Marketing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;22&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Contas a Receber&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;23&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Contas a Pagar&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;25&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Produção&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;26&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Operacional&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;27&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Juridico&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;28&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Vendas&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
Para selecionarmos somente as linhas da tabela Departamento que não 
possuem correspoente na tabela Funcionario, criamos a condição 
&quot;f.Nome is NULL&quot;.&lt;br /&gt;
___________________________________________________________________________________ &lt;br /&gt;
Por enquanto é só pessoal.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Veja também&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/06/joins-parte-1-inner-join.html&quot;&gt;Joins - Parte 1 (Inner Join)&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/06/joins-parte-2-left-join.html&quot;&gt;Joins - Parte 2 (Left Join)&lt;/a&gt; &lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/manipulando-dados-insert.html&quot; target=&quot;_blank&quot;&gt;Manipulando Dados - INSERT&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/manipulando-dados-update.html&quot; target=&quot;_blank&quot;&gt;Manipulando Dados - UPDATE&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/manipulando-dados-delete.html&quot; target=&quot;_blank&quot;&gt;Manipulando Dados - DELETE&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-1.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 1&lt;/a&gt; &lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-2.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 2&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-3.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 3&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-4.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 4&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-5.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 5&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-6.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 6&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-7.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 7&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-8.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 8&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-utilizando-clausula-union.html&quot; target=&quot;_blank&quot;&gt;Select - Utilizando a cláusula UNION&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-agrupando-dados.html&quot;&gt;Select - Agrupando Dados&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlaprendendo.blogspot.com/feeds/5228891788474506977/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/06/joins-parte-3-right-join.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/5228891788474506977'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/5228891788474506977'/><link rel='alternate' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/06/joins-parte-3-right-join.html' title='Joins - Parte 3 (Right Join)'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRYuEtllyuW28ntO52k9iPUA8e8uLx4NTTUrhUFAX-bzfhrxxxEo0G-bIXYCd5VEQy6QBFTTzsKVTruGIkEd7zt1947dF1CpxM87j6fFDmEirVoW08mdLTlq8IqxQtTOSw2BD7QVDRoDPU/s72-c/Right_Join.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4036429675738629295.post-5625593924968394193</id><published>2012-06-07T16:05:00.002-03:00</published><updated>2012-06-07T16:05:17.057-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="join"/><category scheme="http://www.blogger.com/atom/ns#" term="Left Join"/><category scheme="http://www.blogger.com/atom/ns#" term="Left Outer Join"/><category scheme="http://www.blogger.com/atom/ns#" term="MySQL"/><category scheme="http://www.blogger.com/atom/ns#" term="NULL"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><category scheme="http://www.blogger.com/atom/ns#" term="tipos de joins"/><title type='text'>Joins - Parte 2 (Left Join)</title><content type='html'>Continuando nossa série de posts sobre &lt;b&gt;Joins &lt;/b&gt;neste post falaremos sobre &lt;b&gt;Left Join&lt;/b&gt;.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;O diagrama abaixo mostra o que é um &lt;b&gt;Left Join&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikhQ5yRTc6AOyOWM5r-1Qa9KsdcevRGguClAnIgCe4msf7z4ySO7NyX6RvdUz69865AyFQj2QtlrG1xxjk2NLwizMH-txC75CI22XAGu8e98iMv2Xs3nvQ0CPilnpt6Y87EyaXN7l8ZL1r/s1600/Left_Join.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;113&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikhQ5yRTc6AOyOWM5r-1Qa9KsdcevRGguClAnIgCe4msf7z4ySO7NyX6RvdUz69865AyFQj2QtlrG1xxjk2NLwizMH-txC75CI22XAGu8e98iMv2Xs3nvQ0CPilnpt6Y87EyaXN7l8ZL1r/s640/Left_Join.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Analisando as figuras acima podemos dizer que uma junção do tipo &lt;b&gt;Left Join&lt;/b&gt; nada mais é do que o total do conjunto à esquerda. Independente de existir, ou não, um item correspondente no conjunto da direita.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Sintaxe&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Left [Outer] Join&lt;/b&gt; &lt;i&gt;tabela&lt;/i&gt;&lt;b&gt; | &lt;/b&gt;&lt;i&gt;view&lt;/i&gt;&lt;b&gt; On &lt;/b&gt;&lt;i&gt;condição &lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;tabela | view &lt;/i&gt;- tabela ou view que será relacionada no &lt;b&gt;Left Join&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;On &lt;/b&gt;- cláusula onde a condição será especificada.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;condição &lt;/i&gt;- condição que define o &lt;b&gt;Left Join&lt;/b&gt;.&lt;br /&gt;
____________________________________________________________________________________&lt;br /&gt;
&lt;b&gt;Exemplos&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Para os exemplos a seguir vamos utilizar as tabelas Funcionario e Departamento criadas no post &lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/tabelas-para-nossos-exemplos.html&quot;&gt;Tabelas para nossos exemplos&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b style=&quot;color: #3d85c6;&quot;&gt;Conteúdo parcial tabela Funcionario&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/b&gt;&lt;b style=&quot;color: #3d85c6;&quot;&gt;Tabela Departamento&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 432px;&quot;&gt;&lt;colgroup&gt;&lt;col style=&quot;mso-width-alt: 2925; mso-width-source: userset; width: 60pt;&quot; width=&quot;80&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 3840; mso-width-source: userset; width: 79pt;&quot; width=&quot;105&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 1865; mso-width-source: userset; width: 38pt;&quot; width=&quot;51&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 2011; mso-width-source: userset; width: 41pt;&quot; width=&quot;55&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 1865; mso-width-source: userset; width: 38pt;&quot; width=&quot;51&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 3291; mso-width-source: userset; width: 68pt;&quot; width=&quot;90&quot;&gt;&lt;/col&gt;
 &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td class=&quot;xl68&quot; height=&quot;20&quot; style=&quot;background: silver; border: .5pt solid black; color: white; font-family: Calibri; font-size: 10.0pt; font-weight: 700; height: 15.0pt; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;IdFuncionario&lt;/td&gt;
  &lt;td class=&quot;xl72&quot; style=&quot;background: silver; border-left: none; border: .5pt solid black; color: white; font-family: Calibri; font-size: 10.0pt; font-weight: 700; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Nome&lt;/td&gt;
  &lt;td class=&quot;xl69&quot; style=&quot;background: silver; border-left: none; border: .5pt solid black; color: white; font-family: Calibri; font-size: 10.0pt; font-weight: 700; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;IdDepto&lt;/td&gt;
  &lt;td style=&quot;width: 41pt;&quot; width=&quot;55&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background: silver; border: .5pt solid black; color: white; font-family: Calibri; font-size: 10.0pt; font-weight: 700; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;IdDepto&lt;/td&gt;
  &lt;td class=&quot;xl69&quot; style=&quot;background: silver; border-left: none; border: .5pt solid black; color: white; font-family: Calibri; font-size: 10.0pt; font-weight: 700; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 68pt;&quot; width=&quot;90&quot;&gt;NomeDepto&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl66&quot; height=&quot;20&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;1&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Joaquim José&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl67&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;1&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl66&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;1&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 68pt;&quot; width=&quot;90&quot;&gt;Administração&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl66&quot; height=&quot;20&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;2&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Pedro Silva&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl67&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;2&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl66&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;2&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 68pt;&quot; width=&quot;90&quot;&gt;Contabilidade&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl66&quot; height=&quot;20&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;3&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Mário Mattos&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl67&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;3&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl66&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;3&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 68pt;&quot; width=&quot;90&quot;&gt;TI&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl66&quot; height=&quot;20&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;4&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Manuel Antônio&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl67&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;4&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl66&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;4&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 68pt;&quot; width=&quot;90&quot;&gt;Almoxarifado&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl66&quot; height=&quot;20&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;5&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Maria Aparecida&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl67&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;5&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl66&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;5&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 68pt;&quot; width=&quot;90&quot;&gt;Segurança&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl66&quot; height=&quot;20&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;6&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Daniel Borges&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl67&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;6&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl66&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;6&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 68pt;&quot; width=&quot;90&quot;&gt;Controladoria&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl66&quot; height=&quot;20&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;7&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Diana Cristina&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl67&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;7&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl66&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;7&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 68pt;&quot; width=&quot;90&quot;&gt;Compras&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl66&quot; height=&quot;20&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;8&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Miriam Lagos&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl67&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;8&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl70&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;8&lt;/td&gt;
  &lt;td class=&quot;xl71&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 68pt;&quot; width=&quot;90&quot;&gt;Contas a Pagar&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl66&quot; height=&quot;20&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;9&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;José Maria&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl67&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;1&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl66&quot; height=&quot;20&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;10&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Paula Silva&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl67&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;2&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl66&quot; height=&quot;20&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;11&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Vanderlei Santos&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl67&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;3&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl66&quot; height=&quot;20&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;12&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Josefa Cristina&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl67&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;4&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl66&quot; height=&quot;20&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;13&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Carla Maria&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl67&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;5&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl66&quot; height=&quot;20&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;14&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Alex Fabri&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl67&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;12&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl66&quot; height=&quot;20&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;16&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Miguel Angelo&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl67&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;16&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl66&quot; height=&quot;20&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;15&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Vanessa Silva&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl67&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;15&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl70&quot; height=&quot;20&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 60pt;&quot; width=&quot;80&quot;&gt;17&lt;/td&gt;
  &lt;td class=&quot;xl73&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 79pt;&quot; width=&quot;105&quot;&gt;Fernando Silveira&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl71&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 38pt;&quot; width=&quot;51&quot;&gt;19&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
___________________________________________________________________________________ &lt;br /&gt;
&lt;div style=&quot;color: #3d85c6;&quot;&gt;
&lt;br /&gt;
&lt;b&gt;1. Exemplo de Left Join&lt;/b&gt;&lt;/div&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhd8FQRcu44hcFGUN4KaLtOO1BvvFoVQrAqOiJ7av-tLjcdZM76AEhd1EpbOr5gqanir2UtkSJpkJgFm-HJONzv3EsSExRXbkDlL73exJwmo_NIZbZNG0Hyua4ou68qw1aNlh6-YzLc-V6z/s1600/Left_Join_Final.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;142&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhd8FQRcu44hcFGUN4KaLtOO1BvvFoVQrAqOiJ7av-tLjcdZM76AEhd1EpbOr5gqanir2UtkSJpkJgFm-HJONzv3EsSExRXbkDlL73exJwmo_NIZbZNG0Hyua4ou68qw1aNlh6-YzLc-V6z/s200/Left_Join_Final.jpg&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Select &lt;br /&gt;
&amp;nbsp; f.IdFuncionario, f.Nome, d.IdDepto, d.NomeDepto &lt;br /&gt;
From &lt;br /&gt;
&amp;nbsp; Funcionario f&lt;br /&gt;
Left Join Departamento d On (d.IdDepto = f.IdDepto);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdFuncionario&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Nome&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdDepto&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;NomeDepto&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Joaquim José&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Administração&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;2&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Pedro Silva&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;2&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Contabilidade&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Mário Mattos&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;TI&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;4&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Manuel Antônio&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;4&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Almoxarifado&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Maria Aparecida&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Segurança&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;6&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Daniel Borges&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;6&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Controladoria&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;7&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Diana Cristina&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;7&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Compras&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;8&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Miriam Lagos&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;8&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Contas a Pagar&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;9&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;José Maria&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Administração&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;10&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Paula Silva&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;2&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Contabilidade&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;11&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Vanderlei Santos&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;TI&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;12&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Josefa Cristina&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;4&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Almoxarifado&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;13&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Carla Maria&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Segurança&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;14&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Alex Fabri&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;16&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Miguel Angelo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;15&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Vanessa Silva&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;17&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Fernando Silveira&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
Repare que todas as linhas da tabela Funcionario foram selecionadas, mesmo as que não possuem um IdDepto correspondente na tabela Departamento, para estas linhas as colunas IdDepto e NomeDepto são mostradas com valor &lt;a href=&quot;http://pt.wikipedia.org/wiki/Null_%28SQL%29&quot;&gt;NULL&lt;/a&gt;. Porém, &lt;a href=&quot;http://pt.wikipedia.org/wiki/Null_%28SQL%29&quot;&gt;NULL&lt;/a&gt; não é bem o que podemos chamar de valor, &lt;a href=&quot;http://pt.wikipedia.org/wiki/Null_%28SQL%29&quot;&gt;NULL&lt;/a&gt; seria na realidade a ausência de valor.&lt;br /&gt;
___________________________________________________________________________________ &lt;br /&gt;
&lt;div style=&quot;color: #3d85c6;&quot;&gt;
&lt;b&gt;2. Usando Left Join para selecionar as linhas da tabela Funcionario que não possuem correspondente na tabela Departamento&lt;/b&gt;&lt;/div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLyiF9Xa48F6lMxzJ4e_j9US7RSS7z3e422YtfN9BrufNImIxqP_N0n9dKAq9q_v8gIGbGm_UPeyYO68z96xiDqnUVtCHIr7sx-ijSTG4jysO-N9em0h8CzsFJ-CDcBc4zUeuQII41-3vj/s1600/A-B.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;146&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLyiF9Xa48F6lMxzJ4e_j9US7RSS7z3e422YtfN9BrufNImIxqP_N0n9dKAq9q_v8gIGbGm_UPeyYO68z96xiDqnUVtCHIr7sx-ijSTG4jysO-N9em0h8CzsFJ-CDcBc4zUeuQII41-3vj/s200/A-B.jpg&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Select &lt;br /&gt;
&amp;nbsp; f.IdFuncionario, f.Nome, d.IdDepto, d.NomeDepto &lt;br /&gt;
From &lt;br /&gt;
&amp;nbsp; Funcionario f&lt;br /&gt;
Left Join Departamento d On (d.IdDepto = f.IdDepto)&lt;br /&gt;
Where d.IdDepto is NULL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdFuncionario&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Nome&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdDepto&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;NomeDepto&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;14&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Alex Fabri&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;16&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Miguel Angelo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;15&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Vanessa Silva&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;17&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Fernando Silveira&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;NULL&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
Para selecionarmos somente as linhas da tabela Funcionario que não possuem correspoente na tabela Departamento, criamos a condição &quot;d.IdDepto is NULL&quot;.&lt;br /&gt;
___________________________________________________________________________________ &lt;br /&gt;
Por enquanto é só pessoal.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Veja também&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/06/joins-parte-1-inner-join.html&quot;&gt;Joins - Parte 1 (Inner Join)&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/manipulando-dados-insert.html&quot; target=&quot;_blank&quot;&gt;Manipulando Dados - INSERT&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/manipulando-dados-update.html&quot; target=&quot;_blank&quot;&gt;Manipulando Dados - UPDATE&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/manipulando-dados-delete.html&quot; target=&quot;_blank&quot;&gt;Manipulando Dados - DELETE&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-1.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 1&lt;/a&gt; &lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-2.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 2&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-3.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 3&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-4.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 4&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-5.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 5&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-6.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 6&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-7.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 7&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-8.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 8&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-utilizando-clausula-union.html&quot; target=&quot;_blank&quot;&gt;Select - Utilizando a cláusula UNION&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-agrupando-dados.html&quot;&gt;Select - Agrupando Dados&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlaprendendo.blogspot.com/feeds/5625593924968394193/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/06/joins-parte-2-left-join.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/5625593924968394193'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/5625593924968394193'/><link rel='alternate' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/06/joins-parte-2-left-join.html' title='Joins - Parte 2 (Left Join)'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikhQ5yRTc6AOyOWM5r-1Qa9KsdcevRGguClAnIgCe4msf7z4ySO7NyX6RvdUz69865AyFQj2QtlrG1xxjk2NLwizMH-txC75CI22XAGu8e98iMv2Xs3nvQ0CPilnpt6Y87EyaXN7l8ZL1r/s72-c/Left_Join.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4036429675738629295.post-1043767760677924301</id><published>2012-06-02T16:09:00.001-03:00</published><updated>2012-06-02T16:09:16.030-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="banco de dados"/><category scheme="http://www.blogger.com/atom/ns#" term="condição"/><category scheme="http://www.blogger.com/atom/ns#" term="Inner Join"/><category scheme="http://www.blogger.com/atom/ns#" term="join"/><category scheme="http://www.blogger.com/atom/ns#" term="MySQL"/><category scheme="http://www.blogger.com/atom/ns#" term="on"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle"/><category scheme="http://www.blogger.com/atom/ns#" term="relação"/><category scheme="http://www.blogger.com/atom/ns#" term="Select"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><category scheme="http://www.blogger.com/atom/ns#" term="teoria dos conjuntos"/><category scheme="http://www.blogger.com/atom/ns#" term="tipos de joins"/><title type='text'>Joins - Parte 1 (Inner Join)</title><content type='html'>Nesta série de posts falaremos sobre Joins.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;a href=&quot;http://upload.wikimedia.org/wikipedia/commons/6/6d/Venn_A_intersect_B.svg&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;227&quot; src=&quot;http://upload.wikimedia.org/wikipedia/commons/6/6d/Venn_A_intersect_B.svg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Devemos lembrar que um banco de dados relacional é baseado na &lt;a href=&quot;http://pt.wikipedia.org/wiki/Teoria_dos_conjuntos&quot;&gt;teoria dos conjuntos&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Um &lt;b&gt;Join &lt;/b&gt;nada mais é do que uma junção ou relacionamento entre tabelas. Em um banco de dados relacional uma tabela é como um conjunto.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Inner Join&lt;/b&gt;&amp;nbsp; - A figura ao lado (&lt;a href=&quot;http://pt.wikipedia.org/wiki/Diagrama_de_Venn&quot;&gt;diagrama de Venn&lt;/a&gt;) representa a intersecção entre dois conjuntos. Esta figura sempre é utlizada por meu amigo &lt;a href=&quot;http://www.facebook.com/profile.php?id=100000337256242&quot;&gt;Edison Cotrim&lt;/a&gt; para explicar para alguém que não entende quase nada sobre SQL o que é um &lt;b&gt;Inner Join&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
Resumindo um &lt;b&gt;Inner Join&lt;/b&gt; é a intersecção entre duas ou mais tabelas.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Sintaxe&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Inner Join&lt;/b&gt; &lt;i&gt;tabela&lt;/i&gt;&lt;b&gt; | &lt;/b&gt;&lt;i&gt;view&lt;/i&gt;&lt;b&gt; On &lt;/b&gt;&lt;i&gt;condição &lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;tabela | view &lt;/i&gt;- tabela ou view que será relacionada no &lt;b&gt;Join&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;On &lt;/b&gt;- cláusula onde a condição será especificada.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;condição &lt;/i&gt;- condição que define o &lt;b&gt;Join&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
Agora chega de teoria e vamos ao que interessa.&lt;br /&gt;
&lt;br /&gt;
_____________________________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Exemplo&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Para o exemplo a seguir vamos utilizar as tabelas Funcionario e Departamento criadas no post &lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/tabelas-para-nossos-exemplos.html&quot;&gt;Tabelas para nossos exemplos&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b style=&quot;color: #3d85c6;&quot;&gt;Conteúdo parcial tabela Funcionario&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/b&gt;&lt;b style=&quot;color: #3d85c6;&quot;&gt;Tabela Departamento&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;/div&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 476px;&quot;&gt;&lt;colgroup&gt;&lt;col style=&quot;mso-width-alt: 3474; mso-width-source: userset; width: 71pt;&quot; width=&quot;95&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 3693; mso-width-source: userset; width: 76pt;&quot; width=&quot;101&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 2413; mso-width-source: userset; width: 50pt;&quot; width=&quot;66&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 2048; mso-width-source: userset; width: 42pt;&quot; width=&quot;56&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 2450; mso-width-source: userset; width: 50pt;&quot; width=&quot;67&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 3328; mso-width-source: userset; width: 68pt;&quot; width=&quot;91&quot;&gt;&lt;/col&gt;
 &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td class=&quot;xl71&quot; height=&quot;20&quot; style=&quot;background: silver; border: .5pt solid windowtext; color: white; font-family: Calibri; font-size: 10.0pt; font-weight: 700; height: 15.0pt; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 71pt;&quot; width=&quot;95&quot;&gt;IdFuncionario&lt;/td&gt;
  &lt;td class=&quot;xl70&quot; style=&quot;background: silver; border-left: none; border: .5pt solid windowtext; color: white; font-family: Calibri; font-size: 10.0pt; font-weight: 700; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 76pt;&quot; width=&quot;101&quot;&gt;Nome&lt;/td&gt;
  &lt;td class=&quot;xl69&quot; style=&quot;background: silver; border-left: none; border: .5pt solid windowtext; color: white; font-family: Calibri; font-size: 10.0pt; font-weight: 700; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 50pt;&quot; width=&quot;66&quot;&gt;IdDepto&lt;/td&gt;
  &lt;td style=&quot;width: 42pt;&quot; width=&quot;56&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: silver; border: .5pt solid black; color: white; font-family: Calibri; font-size: 10.0pt; font-weight: 700; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 50pt;&quot; width=&quot;67&quot;&gt;IdDepto&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; style=&quot;background: silver; border-left: none; border: .5pt solid black; color: white; font-family: Calibri; font-size: 10.0pt; font-weight: 700; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 68pt;&quot; width=&quot;91&quot;&gt;NomeDepto&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl68&quot; height=&quot;20&quot; style=&quot;background: #D7E4BC; border-top: none; border: .5pt solid windowtext; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #D7E4BC none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 71pt;&quot; width=&quot;95&quot;&gt;1&lt;/td&gt;
  &lt;td class=&quot;xl75&quot; style=&quot;background: #D7E4BC; border-left: none; border-top: none; border: .5pt solid windowtext; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #D7E4BC none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 76pt;&quot; width=&quot;101&quot;&gt;Joaquim José&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl73&quot; style=&quot;background: #D7E4BC; border-left: none; border-top: none; border: .5pt solid windowtext; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #D7E4BC none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 50pt;&quot; width=&quot;66&quot;&gt;1&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl76&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 50pt;&quot; width=&quot;67&quot;&gt;1&lt;/td&gt;
  &lt;td class=&quot;xl77&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 68pt;&quot; width=&quot;91&quot;&gt;Administração&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl68&quot; height=&quot;20&quot; style=&quot;background: #EAF1DD; border-top: none; border: .5pt solid windowtext; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #EAF1DD none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 71pt;&quot; width=&quot;95&quot;&gt;2&lt;/td&gt;
  &lt;td class=&quot;xl75&quot; style=&quot;background: #EAF1DD; border-left: none; border-top: none; border: .5pt solid windowtext; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #EAF1DD none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 76pt;&quot; width=&quot;101&quot;&gt;Pedro Silva&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl73&quot; style=&quot;background: #EAF1DD; border-left: none; border-top: none; border: .5pt solid windowtext; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #EAF1DD none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 50pt;&quot; width=&quot;66&quot;&gt;2&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl76&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 50pt;&quot; width=&quot;67&quot;&gt;2&lt;/td&gt;
  &lt;td class=&quot;xl77&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 68pt;&quot; width=&quot;91&quot;&gt;Contabilidade&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl68&quot; height=&quot;20&quot; style=&quot;background: #D7E4BC; border-top: none; border: .5pt solid windowtext; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #D7E4BC none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 71pt;&quot; width=&quot;95&quot;&gt;3&lt;/td&gt;
  &lt;td class=&quot;xl75&quot; style=&quot;background: #D7E4BC; border-left: none; border-top: none; border: .5pt solid windowtext; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #D7E4BC none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 76pt;&quot; width=&quot;101&quot;&gt;Mário Mattos&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl73&quot; style=&quot;background: #D7E4BC; border-left: none; border-top: none; border: .5pt solid windowtext; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #D7E4BC none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 50pt;&quot; width=&quot;66&quot;&gt;3&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl76&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 50pt;&quot; width=&quot;67&quot;&gt;3&lt;/td&gt;
  &lt;td class=&quot;xl77&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 68pt;&quot; width=&quot;91&quot;&gt;TI&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl68&quot; height=&quot;20&quot; style=&quot;background: #EAF1DD; border-top: none; border: .5pt solid windowtext; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #EAF1DD none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 71pt;&quot; width=&quot;95&quot;&gt;4&lt;/td&gt;
  &lt;td class=&quot;xl75&quot; style=&quot;background: #EAF1DD; border-left: none; border-top: none; border: .5pt solid windowtext; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #EAF1DD none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 76pt;&quot; width=&quot;101&quot;&gt;Manuel Antônio&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl73&quot; style=&quot;background: #EAF1DD; border-left: none; border-top: none; border: .5pt solid windowtext; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #EAF1DD none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 50pt;&quot; width=&quot;66&quot;&gt;4&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl76&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 50pt;&quot; width=&quot;67&quot;&gt;4&lt;/td&gt;
  &lt;td class=&quot;xl77&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 68pt;&quot; width=&quot;91&quot;&gt;Almoxarifado&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl68&quot; height=&quot;20&quot; style=&quot;background: #D7E4BC; border-top: none; border: .5pt solid windowtext; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #D7E4BC none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 71pt;&quot; width=&quot;95&quot;&gt;5&lt;/td&gt;
  &lt;td class=&quot;xl75&quot; style=&quot;background: #D7E4BC; border-left: none; border-top: none; border: .5pt solid windowtext; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #D7E4BC none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 76pt;&quot; width=&quot;101&quot;&gt;Maria Aparecida&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl73&quot; style=&quot;background: #D7E4BC; border-left: none; border-top: none; border: .5pt solid windowtext; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #D7E4BC none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 50pt;&quot; width=&quot;66&quot;&gt;5&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl76&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 50pt;&quot; width=&quot;67&quot;&gt;5&lt;/td&gt;
  &lt;td class=&quot;xl77&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 68pt;&quot; width=&quot;91&quot;&gt;Segurança&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl68&quot; height=&quot;20&quot; style=&quot;background: #EAF1DD; border-top: none; border: .5pt solid windowtext; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #EAF1DD none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 71pt;&quot; width=&quot;95&quot;&gt;6&lt;/td&gt;
  &lt;td class=&quot;xl75&quot; style=&quot;background: #EAF1DD; border-left: none; border-top: none; border: .5pt solid windowtext; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #EAF1DD none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 76pt;&quot; width=&quot;101&quot;&gt;Daniel Borges&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl73&quot; style=&quot;background: #EAF1DD; border-left: none; border-top: none; border: .5pt solid windowtext; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #EAF1DD none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 50pt;&quot; width=&quot;66&quot;&gt;6&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl76&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 50pt;&quot; width=&quot;67&quot;&gt;6&lt;/td&gt;
  &lt;td class=&quot;xl77&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 68pt;&quot; width=&quot;91&quot;&gt;Controladoria&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl68&quot; height=&quot;20&quot; style=&quot;background: #D7E4BC; border-top: none; border: .5pt solid windowtext; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #D7E4BC none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 71pt;&quot; width=&quot;95&quot;&gt;7&lt;/td&gt;
  &lt;td class=&quot;xl75&quot; style=&quot;background: #D7E4BC; border-left: none; border-top: none; border: .5pt solid windowtext; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #D7E4BC none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 76pt;&quot; width=&quot;101&quot;&gt;Diana Cristina&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl73&quot; style=&quot;background: #D7E4BC; border-left: none; border-top: none; border: .5pt solid windowtext; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #D7E4BC none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 50pt;&quot; width=&quot;66&quot;&gt;7&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl76&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 50pt;&quot; width=&quot;67&quot;&gt;7&lt;/td&gt;
  &lt;td class=&quot;xl77&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 68pt;&quot; width=&quot;91&quot;&gt;Compras&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl68&quot; height=&quot;20&quot; style=&quot;background: #EAF1DD; border-top: none; border: .5pt solid windowtext; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #EAF1DD none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 71pt;&quot; width=&quot;95&quot;&gt;8&lt;/td&gt;
  &lt;td class=&quot;xl75&quot; style=&quot;background: #EAF1DD; border-left: none; border-top: none; border: .5pt solid windowtext; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #EAF1DD none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 76pt;&quot; width=&quot;101&quot;&gt;Miriam Lagos&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl73&quot; style=&quot;background: #EAF1DD; border-left: none; border-top: none; border: .5pt solid windowtext; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #EAF1DD none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 50pt;&quot; width=&quot;66&quot;&gt;8&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl78&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 50pt;&quot; width=&quot;67&quot;&gt;8&lt;/td&gt;
  &lt;td class=&quot;xl79&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 68pt;&quot; width=&quot;91&quot;&gt;Contas a Pagar&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl68&quot; height=&quot;20&quot; style=&quot;background: #D7E4BC; border-top: none; border: .5pt solid windowtext; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #D7E4BC none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 71pt;&quot; width=&quot;95&quot;&gt;9&lt;/td&gt;
  &lt;td class=&quot;xl75&quot; style=&quot;background: #D7E4BC; border-left: none; border-top: none; border: .5pt solid windowtext; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #D7E4BC none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 76pt;&quot; width=&quot;101&quot;&gt;José Maria&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl73&quot; style=&quot;background: #D7E4BC; border-left: none; border-top: none; border: .5pt solid windowtext; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #D7E4BC none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 50pt;&quot; width=&quot;66&quot;&gt;1&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl68&quot; height=&quot;20&quot; style=&quot;background: #EAF1DD; border-top: none; border: .5pt solid windowtext; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #EAF1DD none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 71pt;&quot; width=&quot;95&quot;&gt;10&lt;/td&gt;
  &lt;td class=&quot;xl75&quot; style=&quot;background: #EAF1DD; border-left: none; border-top: none; border: .5pt solid windowtext; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #EAF1DD none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 76pt;&quot; width=&quot;101&quot;&gt;Paula Silva&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl73&quot; style=&quot;background: #EAF1DD; border-left: none; border-top: none; border: .5pt solid windowtext; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #EAF1DD none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 50pt;&quot; width=&quot;66&quot;&gt;2&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl68&quot; height=&quot;20&quot; style=&quot;background: #D7E4BC; border-top: none; border: .5pt solid windowtext; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #D7E4BC none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 71pt;&quot; width=&quot;95&quot;&gt;11&lt;/td&gt;
  &lt;td class=&quot;xl75&quot; style=&quot;background: #D7E4BC; border-left: none; border-top: none; border: .5pt solid windowtext; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #D7E4BC none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 76pt;&quot; width=&quot;101&quot;&gt;Vanderlei Santos&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl73&quot; style=&quot;background: #D7E4BC; border-left: none; border-top: none; border: .5pt solid windowtext; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #D7E4BC none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 50pt;&quot; width=&quot;66&quot;&gt;3&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl68&quot; height=&quot;20&quot; style=&quot;background: #EAF1DD; border-top: none; border: .5pt solid windowtext; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #EAF1DD none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 71pt;&quot; width=&quot;95&quot;&gt;12&lt;/td&gt;
  &lt;td class=&quot;xl75&quot; style=&quot;background: #EAF1DD; border-left: none; border-top: none; border: .5pt solid windowtext; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #EAF1DD none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 76pt;&quot; width=&quot;101&quot;&gt;Josefa Cristina&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl73&quot; style=&quot;background: #EAF1DD; border-left: none; border-top: none; border: .5pt solid windowtext; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #EAF1DD none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 50pt;&quot; width=&quot;66&quot;&gt;4&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl72&quot; height=&quot;20&quot; style=&quot;background: #D7E4BC; border-top: none; border: .5pt solid windowtext; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #D7E4BC none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 71pt;&quot; width=&quot;95&quot;&gt;13&lt;/td&gt;
  &lt;td class=&quot;xl74&quot; style=&quot;background: #D7E4BC; border-left: none; border-top: none; border: .5pt solid windowtext; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #D7E4BC none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 76pt;&quot; width=&quot;101&quot;&gt;Carla Maria&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl67&quot; style=&quot;background: #D7E4BC; border-left: none; border-top: none; border: .5pt solid windowtext; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #D7E4BC none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 50pt;&quot; width=&quot;66&quot;&gt;5&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;br /&gt;
&lt;b style=&quot;color: #3d85c6;&quot;&gt;Relacionando os funcionários aos seus respectivos departamentos&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;Select&lt;br /&gt;
&amp;nbsp; f.IdFuncionario, f.Nome, d.IdDepto, d.NomeDepto&lt;br /&gt;
From&lt;br /&gt;
&amp;nbsp; Funcionario f&lt;br /&gt;
Inner Join Departamento d On (d.IdDepto = f.IdDepto);&lt;br /&gt;
&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 356px;&quot;&gt;&lt;colgroup&gt;&lt;col style=&quot;mso-width-alt: 3657; mso-width-source: userset; width: 75pt;&quot; width=&quot;100&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 3693; mso-width-source: userset; width: 76pt;&quot; width=&quot;101&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 2377; mso-width-source: userset; width: 49pt;&quot; width=&quot;65&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 3291; mso-width-source: userset; width: 68pt;&quot; width=&quot;90&quot;&gt;&lt;/col&gt;
 &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td class=&quot;xl66&quot; height=&quot;20&quot; style=&quot;background: silver; border: .5pt solid black; color: white; font-family: Calibri; font-size: 10.0pt; font-weight: 700; height: 15.0pt; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 75pt;&quot; width=&quot;100&quot;&gt;IdFuncionario&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background: silver; border-left: none; border: .5pt solid black; color: white; font-family: Calibri; font-size: 10.0pt; font-weight: 700; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 76pt;&quot; width=&quot;101&quot;&gt;Nome&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background: silver; border-left: none; border: .5pt solid black; color: white; font-family: Calibri; font-size: 10.0pt; font-weight: 700; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;IdDepto&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background: silver; border-left: none; border: .5pt solid black; color: white; font-family: Calibri; font-size: 10.0pt; font-weight: 700; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 68pt;&quot; width=&quot;90&quot;&gt;NomeDepto&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 75pt;&quot; width=&quot;100&quot;&gt;1&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 76pt;&quot; width=&quot;101&quot;&gt;Joaquim José&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl63&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;1&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 68pt;&quot; width=&quot;90&quot;&gt;Administração&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 75pt;&quot; width=&quot;100&quot;&gt;2&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 76pt;&quot; width=&quot;101&quot;&gt;Pedro Silva&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl63&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;2&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 68pt;&quot; width=&quot;90&quot;&gt;Contabilidade&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 75pt;&quot; width=&quot;100&quot;&gt;3&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 76pt;&quot; width=&quot;101&quot;&gt;Mário Mattos&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl63&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;3&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 68pt;&quot; width=&quot;90&quot;&gt;TI&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 75pt;&quot; width=&quot;100&quot;&gt;4&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 76pt;&quot; width=&quot;101&quot;&gt;Manuel Antônio&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl63&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;4&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 68pt;&quot; width=&quot;90&quot;&gt;Almoxarifado&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 75pt;&quot; width=&quot;100&quot;&gt;5&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 76pt;&quot; width=&quot;101&quot;&gt;Maria Aparecida&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl63&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;5&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 68pt;&quot; width=&quot;90&quot;&gt;Segurança&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 75pt;&quot; width=&quot;100&quot;&gt;6&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 76pt;&quot; width=&quot;101&quot;&gt;Daniel Borges&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl63&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;6&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 68pt;&quot; width=&quot;90&quot;&gt;Controladoria&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 75pt;&quot; width=&quot;100&quot;&gt;7&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 76pt;&quot; width=&quot;101&quot;&gt;Diana Cristina&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl63&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;7&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 68pt;&quot; width=&quot;90&quot;&gt;Compras&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 75pt;&quot; width=&quot;100&quot;&gt;8&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 76pt;&quot; width=&quot;101&quot;&gt;Miriam Lagos&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl63&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;8&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 68pt;&quot; width=&quot;90&quot;&gt;Contas a Pagar&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 75pt;&quot; width=&quot;100&quot;&gt;9&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 76pt;&quot; width=&quot;101&quot;&gt;José Maria&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl63&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;1&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 68pt;&quot; width=&quot;90&quot;&gt;Administração&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 75pt;&quot; width=&quot;100&quot;&gt;10&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 76pt;&quot; width=&quot;101&quot;&gt;Paula Silva&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl63&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;2&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 68pt;&quot; width=&quot;90&quot;&gt;Contabilidade&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 75pt;&quot; width=&quot;100&quot;&gt;11&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 76pt;&quot; width=&quot;101&quot;&gt;Vanderlei Santos&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl63&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;3&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 68pt;&quot; width=&quot;90&quot;&gt;TI&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background: #DBE5F1; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 75pt;&quot; width=&quot;100&quot;&gt;12&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 76pt;&quot; width=&quot;101&quot;&gt;Josefa Cristina&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl63&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;4&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 68pt;&quot; width=&quot;90&quot;&gt;Almoxarifado&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl69&quot; height=&quot;20&quot; style=&quot;background: #B8CCE4; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 75pt;&quot; width=&quot;100&quot;&gt;13&lt;/td&gt;
  &lt;td class=&quot;xl70&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 76pt;&quot; width=&quot;101&quot;&gt;Carla Maria&lt;/td&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl70&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 49pt;&quot; width=&quot;65&quot;&gt;5&lt;/td&gt;
  &lt;td class=&quot;xl71&quot; style=&quot;background: #B8CCE4; border-left: none; border-top: none; border: .5pt solid black; color: black; font-family: Calibri; font-size: 10.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 68pt;&quot; width=&quot;90&quot;&gt;Segurança&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
Na consulta acima definimos apelidos (aliases)&amp;nbsp; para as tabelas, isso facilita nossa vida na hora de fazer os relacionamentos e referência das colunas. Já falamos sobre a utilização de apelidos em colunas no post &lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-5.html&quot;&gt;Select Básico - Parte 5&lt;/a&gt;. Para a tabela Funcionario a letra &lt;b&gt;&quot;f&quot;&lt;/b&gt; foi colocada logo após o nome da tabela definindo assim seu apelido, e a&amp;nbsp; letra &quot;&lt;b&gt;d&lt;/b&gt;&quot; foi definida como o apelido da tabela Departamento.&lt;br /&gt;
&lt;br /&gt;
O que determina o relacionamento (&lt;b&gt;Join&lt;/b&gt;) entre as tabelas Funcionario e Departamento é a condição de igualdade especificada na cláusula &lt;b&gt;On &lt;/b&gt;entre as colunas IdDepto. Isto é, a consulta traz as linhas que possuem&amp;nbsp; os valores das colunas IdDepto iguais entre as tabelas.&lt;br /&gt;
&lt;br /&gt;
Outro detalhe importante quando utilizamos &lt;b&gt;Joins &lt;/b&gt;é especificar a qual tabela cada coluna pertence. Isso é feito colocando antes do nome da coluna o apelido da tabela ou o nome da mesma acrescido de &quot;&lt;b&gt;.&lt;/b&gt;&quot;, ous seja: &amp;lt;tabela | apelido&amp;gt;.&amp;lt;coluna&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Quais as vantagens disso:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; - A consulta fica melhor documentada;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; - Caso duas ou mais tabelas tenham o mesmo nome de coluna não receberemos uma mensagem de erro;&lt;br /&gt;
___________________________________________________________________________________ &lt;br /&gt;
Por enquanto é só pessoal.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Veja também&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/manipulando-dados-insert.html&quot; target=&quot;_blank&quot;&gt;Manipulando Dados - INSERT&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/manipulando-dados-update.html&quot; target=&quot;_blank&quot;&gt;Manipulando Dados - UPDATE&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/manipulando-dados-delete.html&quot; target=&quot;_blank&quot;&gt;Manipulando Dados - DELETE&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-1.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 1&lt;/a&gt; &lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-2.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 2&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-3.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 3&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-4.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 4&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-5.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 5&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-6.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 6&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-7.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 7&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-8.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 8&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-utilizando-clausula-union.html&quot; target=&quot;_blank&quot;&gt;Select - Utilizando a cláusula UNION&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-agrupando-dados.html&quot;&gt;Select - Agrupando Dados&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlaprendendo.blogspot.com/feeds/1043767760677924301/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/06/joins-parte-1-inner-join.html#comment-form' title='1 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/1043767760677924301'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/1043767760677924301'/><link rel='alternate' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/06/joins-parte-1-inner-join.html' title='Joins - Parte 1 (Inner Join)'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4036429675738629295.post-4773131063904344969</id><published>2012-05-28T22:03:00.000-03:00</published><updated>2012-05-28T22:03:08.038-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AVG"/><category scheme="http://www.blogger.com/atom/ns#" term="COUNT"/><category scheme="http://www.blogger.com/atom/ns#" term="Group by"/><category scheme="http://www.blogger.com/atom/ns#" term="MAX"/><category scheme="http://www.blogger.com/atom/ns#" term="MIN"/><category scheme="http://www.blogger.com/atom/ns#" term="MySQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle"/><category scheme="http://www.blogger.com/atom/ns#" term="Select"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><category scheme="http://www.blogger.com/atom/ns#" term="SUM"/><title type='text'>Select - Agrupando Dados</title><content type='html'>Neste post falaremos como agrupar dados e como utilizar funções de agregação.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;Para agrupar dados em consultas SQL utilizamos a cláusula GROUP BY.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Sintaxe&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
GROUP BY &lt;i&gt;expressão&lt;/i&gt;,[...,n]&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;expressão &lt;/i&gt;- qualquer expressão válida.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Observação:&lt;/b&gt; As expressões ou colunas que forem utilizadas no SELECT e não forem utilizadas em funções de agregação devem ser especificadas na cláusula GROUP BY.&lt;br /&gt;
&lt;br /&gt;
____________________________________________________________________________________&lt;br /&gt;
&lt;b&gt;Funções de Agregação&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 530px;&quot;&gt;&lt;colgroup&gt;&lt;col style=&quot;mso-width-alt: 2889; mso-width-source: userset; width: 59pt;&quot; width=&quot;79&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 6400; mso-width-source: userset; width: 131pt;&quot; width=&quot;175&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 10093; mso-width-source: userset; width: 207pt;&quot; width=&quot;276&quot;&gt;&lt;/col&gt;
 &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr height=&quot;21&quot; style=&quot;height: 15.75pt;&quot;&gt;
  &lt;td class=&quot;xl65&quot; height=&quot;21&quot; style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: .5pt solid white; color: black; font-family: Calibri; font-size: 12.0pt; font-weight: 700; height: 15.75pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 59pt;&quot; width=&quot;79&quot;&gt;Função&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: .5pt solid white; color: black; font-family: Calibri; font-size: 12.0pt; font-weight: 700; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 131pt;&quot; width=&quot;175&quot;&gt;Descrição&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: none; border-top: .5pt solid white; color: black; font-family: Calibri; font-size: 12.0pt; font-weight: 700; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 207pt;&quot; width=&quot;276&quot;&gt;Sintaxe&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td height=&quot;20&quot; style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;AVG&lt;/td&gt;
  &lt;td style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;Retorna o valor
  médio&amp;nbsp;&lt;/td&gt;
  &lt;td style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: none; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;AVG ( [ALL | DISTINCT]
  expressão )&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td height=&quot;20&quot; style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;MIN&lt;/td&gt;
  &lt;td style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;Retorna o menor
  valor&amp;nbsp;&lt;/td&gt;
  &lt;td style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: none; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;MIN ( [ALL | DISTINCT]
  expressão )&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td height=&quot;20&quot; style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;MAX&lt;/td&gt;
  &lt;td style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;Retorna o maior
  valor&lt;/td&gt;
  &lt;td style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: none; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;MAX ( [ALL | DISTINCT]
  expressão )&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td height=&quot;20&quot; style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;SUM&lt;/td&gt;
  &lt;td style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;Retorna a soma&lt;/td&gt;
  &lt;td style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: none; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;SUM ( [ALL | DISTINCT]
  expressão )&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td height=&quot;20&quot; style=&quot;background: #DBE5F1; border-bottom: none; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;COUNT&lt;/td&gt;
  &lt;td style=&quot;background: #DBE5F1; border-bottom: none; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;Retorna o número de itens&lt;/td&gt;
  &lt;td style=&quot;background: #DBE5F1; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;COUNT ( { [ALL | DISTINCT]
  expressão} | * )&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;i&gt;expressão &lt;/i&gt;- qualquer expressão válida.&lt;br /&gt;
____________________________________________________________________________________&lt;br /&gt;
&lt;b&gt;Exemplos&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Nos exemplos abaixo utilizaremos as tabelas Funcionario e Produto criadas e populadas nos posts: &lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/tabelas-para-nossos-exemplos.html&quot; target=&quot;_blank&quot;&gt;Tabelas para nossos exemplos&lt;/a&gt; e &lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-5.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 5&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b style=&quot;color: #3d85c6;&quot;&gt;1. Agrupando os dados da tabela Funcionário por Bairro e UF&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Select Bairro,UF From Funcionario Group by Bairro,UF;&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Bairro&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;UF&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Morumbi&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;RJ&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Penha&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;RJ&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Perdizes&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;AM&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Geraldo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Tatuape&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Vila Verde&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;CE&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
____________________________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
&lt;b style=&quot;color: #3d85c6;&quot;&gt;2. Agrupando os dados da tabela Funcionário por Bairro, UF e contando as linhas de cada grupo&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Select Bairro,UF,Count(*) as Total From Funcionario Group by Bairro,UF;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Bairro&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;UF&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Total&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Morumbi&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;RJ&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Penha&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;RJ&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Perdizes&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;AM&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Geraldo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Tatuape&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Vila Verde&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;CE&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
____________________________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
&lt;b style=&quot;color: #3d85c6;&quot;&gt;3. Selecionando o menor e o maior preço unitário da tabela produto&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Select &lt;br /&gt;
&amp;nbsp;Max(PrecoUnitario) As MaiorPrecoUnitario,&lt;br /&gt;
&amp;nbsp;Min(PrecoUnitario) As MenorPrecoUnitario&lt;br /&gt;
From Produto;&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;MaiorPrecoUnitario&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;MenorPrecoUnitario&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1501.73&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;23.97&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
____________________________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
&lt;b style=&quot;color: #3d85c6;&quot;&gt;4. Valor total do estoque&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Select Sum(PrecoUnitario * QtdeEstoque) As ValorTotalEstoque From Produto;&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;ValorTotalEstoque&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1409183.68&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
____________________________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
&lt;b style=&quot;color: #3d85c6;&quot;&gt;5. Média de preços dos produtos&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Select AVG(PrecoUnitario) As MediaPrecoUnitario From Produto;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;MediaPrecoUnitario&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;487.673000&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
___________________________________________________________________________________ &lt;br /&gt;
Por enquanto é só pessoal.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Veja também&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/manipulando-dados-insert.html&quot; target=&quot;_blank&quot;&gt;Manipulando Dados - INSERT&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/manipulando-dados-update.html&quot; target=&quot;_blank&quot;&gt;Manipulando Dados - UPDATE&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/manipulando-dados-delete.html&quot; target=&quot;_blank&quot;&gt;Manipulando Dados - DELETE&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-1.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 1&lt;/a&gt; &lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-2.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 2&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-3.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 3&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-4.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 4&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-5.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 5&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-6.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 6&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-7.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 7&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-8.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 8&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-utilizando-clausula-union.html&quot; target=&quot;_blank&quot;&gt;Select - Utilizando a cláusula UNION&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlaprendendo.blogspot.com/feeds/4773131063904344969/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/05/select-agrupando-dados.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/4773131063904344969'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/4773131063904344969'/><link rel='alternate' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/05/select-agrupando-dados.html' title='Select - Agrupando Dados'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4036429675738629295.post-1580674769558266842</id><published>2012-05-27T15:20:00.002-03:00</published><updated>2012-05-27T15:23:02.429-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Delete"/><category scheme="http://www.blogger.com/atom/ns#" term="Distinct"/><category scheme="http://www.blogger.com/atom/ns#" term="Manipulando Dados"/><category scheme="http://www.blogger.com/atom/ns#" term="MySQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><category scheme="http://www.blogger.com/atom/ns#" term="SQLite"/><category scheme="http://www.blogger.com/atom/ns#" term="Update"/><title type='text'>Manipulando Dados - UPDATE</title><content type='html'>O comando UPDATE permite a alteração dos dados de uma determinada tabela.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;b&gt;Sintaxe&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
UPDATE &lt;br /&gt;
&amp;nbsp;&lt;b&gt;&amp;lt;tabela&amp;gt; | &amp;lt;view&amp;gt;&lt;/b&gt;&lt;br /&gt;
SET&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;i&gt;coluna &lt;/i&gt;[ ,&lt;i&gt;coluna&lt;/i&gt;...] = { &lt;i&gt;expressão &lt;/i&gt;}&lt;br /&gt;
[WHERE &amp;lt;condição&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Onde:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&amp;lt;tabela&amp;gt; | &amp;lt;view&amp;gt; - &lt;/b&gt;Tabela ou view utilizada na alteração.&lt;br /&gt;
&lt;br /&gt;
SET - Especifica a lista de colunas que serão alteradas. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;coluna &lt;/i&gt;-&amp;nbsp; Coluna que será alterada.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;expressão &lt;/i&gt;- Qualquer expressão válida. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
WHERE - Cláusula usada para definição das condições.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&amp;lt;condição&amp;gt; - &lt;/b&gt;Define a condição para alteração dos dados. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Observação:&lt;/b&gt;&amp;nbsp; CUIDADO, caso a cláusula WHERE não seja utilizada todas as linhas da tabela serão alteradas.&lt;br /&gt;
____________________________________________________________________________________&lt;br /&gt;
&lt;b&gt;Exemplos&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Nos exemplos abaixo utilizaremos&lt;b&gt; &lt;/b&gt;a tabelas Produto criada no post &lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-5.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 5&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Tabela Produto&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdProduto&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;NomeProduto&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;PrecoUnitario&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;QtdeEstoque&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;TV LCD 32&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1250.50&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;120&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;2&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;DVD&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;220.80&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;300&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Notebook i5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1300.20&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;170&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;4&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Pendrive 2MB&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;20.75&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;100&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Camera Fotografica&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;179.20&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;255&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;6&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Filmadora&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;350.77&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;75&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;7&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Blu-Ray&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;319.90&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;500&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;8&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;GPS&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;377.89&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;180&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;9&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Celular&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;89.99&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;277&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;10&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;MP3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;183.77&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;280&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: #3d85c6;&quot;&gt;
&lt;b&gt;1. Aumentando em 10% o preço de todos os produtos&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
Update Produto Set PrecoUnitario = PrecoUnitario * 1.1;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdProduto&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;NomeProduto&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;PrecoUnitario&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;QtdeEstoque&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;TV LCD 32&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1375.55&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;120&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;2&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;DVD&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;242.88&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;300&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Notebook i5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1430.22&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;170&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;4&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Pendrive 2MB&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;22.83&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;100&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Camera Fotografica&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;197.12&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;255&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;6&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Filmadora&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;385.85&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;75&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;7&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Blu-Ray&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;351.89&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;500&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;8&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;GPS&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;415.68&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;180&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;9&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Celular&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;98.99&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;277&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;10&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;MP3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;202.15&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;280&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
___________________________________________________________________________________&lt;br /&gt;
&lt;div style=&quot;color: #3d85c6;&quot;&gt;
&lt;br /&gt;
&lt;b&gt;2. Aumentando em 100 a quantidade de estoque dos produtos com código maior que 4&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
Update Produto Set QtdeEstoque = QtdeEstoque + 100 Where IdProduto &amp;gt; 4;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdProduto&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;NomeProduto&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;PrecoUnitario&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;QtdeEstoque&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;TV LCD 32&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1375.55&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;120&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;2&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;DVD&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;242.88&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;300&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Notebook i5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1430.22&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;170&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;4&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Pendrive 2MB&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;22.83&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;100&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Camera Fotografica&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;197.12&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;255&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;6&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Filmadora&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;385.85&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;75&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;7&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Blu-Ray&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;351.89&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;500&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;8&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;GPS&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;415.68&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;180&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;9&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Celular&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;98.99&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;277&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;10&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;MP3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;202.15&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;280&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
___________________________________________________________________________________ &lt;br /&gt;
&lt;div style=&quot;color: #3d85c6;&quot;&gt;
&lt;b&gt;3. Aumentando em 100 a quantidade de estoque e acrescentado 5% ao preço unitário &lt;/b&gt;&lt;b&gt;dos produtos com código menor que 5&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
Update&lt;br /&gt;
Produto Set&lt;br /&gt;
&amp;nbsp;&amp;nbsp; QtdeEstoque = QtdeEstoque + 100,&lt;br /&gt;
&amp;nbsp;&amp;nbsp; PrecoUnitario = PrecoUnitario * 1.05&lt;br /&gt;
Where IdProduto &amp;lt; 5;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdProduto&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;NomeProduto&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;PrecoUnitario&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;QtdeEstoque&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;TV LCD 32&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1444.33&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;220&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;2&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;DVD&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;255.02&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;400&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Notebook i5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1501.73&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;270&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;4&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Pendrive 2MB&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;23.97&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;200&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Camera Fotografica&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;197.12&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;355&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;6&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Filmadora&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;385.85&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;175&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;7&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Blu-Ray&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;351.89&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;600&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;8&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;GPS&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;415.68&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;280&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;9&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Celular&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;98.99&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;377&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;10&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;MP3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;202.15&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;380&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
___________________________________________________________________________________ &lt;br /&gt;
Por enquanto é só pessoal.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Veja também&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/manipulando-dados-delete.html&quot; target=&quot;_blank&quot;&gt;Manipulando Dados - DELETE&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-1.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 1&lt;/a&gt; &lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-2.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 2&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-3.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 3&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-4.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 4&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-5.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 5&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-6.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 6&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-7.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 7&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-8.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 8&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-utilizando-clausula-union.html&quot; target=&quot;_blank&quot;&gt;Select - Utilizando a cláusula UNION&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlaprendendo.blogspot.com/feeds/1580674769558266842/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/05/manipulando-dados-update.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/1580674769558266842'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/1580674769558266842'/><link rel='alternate' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/05/manipulando-dados-update.html' title='Manipulando Dados - UPDATE'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4036429675738629295.post-1416496830108672610</id><published>2012-05-26T13:07:00.001-03:00</published><updated>2012-05-27T15:55:15.103-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Delete"/><category scheme="http://www.blogger.com/atom/ns#" term="MySQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle"/><category scheme="http://www.blogger.com/atom/ns#" term="PL/SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Select"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><title type='text'>Manipulando Dados - DELETE</title><content type='html'>Neste post vamos mostrar como excluir linhas de uma tabela.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;O comando DELETE exclui linhas de uma determinada tabela. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Sintaxe&lt;/b&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DELETE&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; [ FROM { &amp;lt;tabela&amp;gt; | &amp;lt;view&amp;gt;} [ ,...n ] ]&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; [ WHERE &amp;lt;condição&amp;gt; ]&lt;br /&gt;
&lt;br /&gt;
Onde:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&amp;lt;tabela&amp;gt; | &amp;lt;view&amp;gt; - &lt;/b&gt;Tabela(s) ou view(s) utilizada(s) na exclusão.&lt;br /&gt;
&lt;br /&gt;
WHERE - cláusula usada para definição das condições.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&amp;lt;condição&amp;gt; - &lt;/b&gt;Define a condição para exclusão. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Observação:&lt;/b&gt;&amp;nbsp; CUIDADO, caso a cláusula WHERE não seja utilizada todas as linhas da tabela serão excluidas. &lt;br /&gt;
____________________________________________________________________________________&lt;br /&gt;
&lt;b&gt;Exemplos&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Nos exemplos abaixo utilizaremos&lt;b&gt; &lt;/b&gt;a tabelas Produto criada no post &lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-5.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 5&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Tabela Produto&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdProduto&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;NomeProduto&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;PrecoUnitario&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;QtdeEstoque&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;TV LCD 32&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1050.50&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;120&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;2&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;DVD&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;220.80&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;300&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Notebook i5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1300.20&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;170&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;4&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Pendrive 2MB&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;20.75&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;100&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Camera Fotografica&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;179.20&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;255&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;6&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Filmadora&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;350.77&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;75&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;7&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Blu-Ray&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;319.90&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;500&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;8&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;GPS&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;377.89&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;180&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;9&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Celular&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;89.99&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;277&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;10&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;MP3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;183.77&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;280&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;11&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Fogão de 4 Bocas&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;500.00&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;300&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;12&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Geladeira 270 litros&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;500.00&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1500&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;div style=&quot;color: #3d85c6;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3d85c6;&quot;&gt;
&lt;b&gt;1. Excluindo produtos com código maior que 10&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
Delete From Produto Where IdProduto &amp;gt; 10;&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdProduto&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;NomeProduto&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;PrecoUnitario&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;QtdeEstoque&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;TV LCD 32&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1050.50&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;120&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;2&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;DVD&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;220.80&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;300&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Notebook i5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1300.20&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;170&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;4&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Pendrive 2MB&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;20.75&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;100&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Camera Fotografica&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;179.20&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;255&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;6&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Filmadora&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;350.77&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;75&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;7&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Blu-Ray&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;319.90&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;500&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;8&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;GPS&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;377.89&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;180&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;9&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Celular&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;89.99&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;277&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;10&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;MP3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;183.77&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;280&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
___________________________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: #3d85c6;&quot;&gt;
&lt;b&gt;2. Utilizando uma expressão para excluir produtos&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
Delete From&amp;nbsp; Produto Where PrecoUnitario &amp;gt; 5*200;&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdProduto&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;NomeProduto&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;PrecoUnitario&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;QtdeEstoque&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;2&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;DVD&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;220.80&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;300&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;4&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Pendrive 2MB&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;20.75&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;100&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Camera Fotografica&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;179.20&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;255&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;6&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Filmadora&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;350.77&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;75&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;7&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Blu-Ray&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;319.90&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;500&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;8&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;GPS&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;377.89&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;180&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;9&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Celular&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;89.99&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;277&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;10&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;MP3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;183.77&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;280&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
___________________________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
Por enquanto é só pessoal.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Veja também&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-1.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 1&lt;/a&gt; &lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-2.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 2&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-3.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 3&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-4.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 4&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-5.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 5&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-6.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 6&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-7.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 7&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-8.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 8&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-utilizando-clausula-union.html&quot; target=&quot;_blank&quot;&gt;Select - Utilizando a cláusula UNION&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlaprendendo.blogspot.com/feeds/1416496830108672610/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/05/manipulando-dados-delete.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/1416496830108672610'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/1416496830108672610'/><link rel='alternate' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/05/manipulando-dados-delete.html' title='Manipulando Dados - DELETE'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4036429675738629295.post-3821875369007294340</id><published>2012-05-22T23:25:00.000-03:00</published><updated>2012-05-27T15:55:31.734-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Insert"/><category scheme="http://www.blogger.com/atom/ns#" term="MySQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle"/><category scheme="http://www.blogger.com/atom/ns#" term="Select"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><title type='text'>Manipulando Dados - INSERT</title><content type='html'>Nesta série de posts falaremos sobre comandos de&amp;nbsp; manipulação de dados. Vamos começar pelo comando Insert.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;O comando INSERT adiciona linhas em uma determinada tabela.&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Sintaxe&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
INSERT [INTO] &lt;br /&gt;
&amp;nbsp; &lt;i&gt;nome da tabela&lt;/i&gt;&amp;nbsp; [ ( &lt;i&gt;lista de colunas&lt;/i&gt; ) ] &lt;br /&gt;
VALUES &lt;br /&gt;
&amp;nbsp; (&lt;i&gt; lista de expressões&lt;/i&gt; ) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INTO - parâmetro opcional para indicar o nome da tabela;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;nome da tabela&lt;/i&gt; - nome da tabela que receberá os dados;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;lista de colunas&lt;/i&gt; - colunas que receberão os dados;&lt;br /&gt;
&lt;br /&gt;
VALUES - introduz a &lt;i&gt;lista de expressões&lt;/i&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;lista de expressões&lt;/i&gt; - valores fixos e expressões;
&lt;br /&gt;
&lt;br /&gt;
__________________________________________________________________________________&lt;br /&gt;
&lt;b&gt;Exemplos&lt;/b&gt; &lt;br /&gt;
&lt;br /&gt;
Nos exemplos abaixo utilizaremos a tabela Produto ver: &lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/tabelas-para-nossos-exemplos.html&quot; target=&quot;_blank&quot;&gt;Tabelas para nossos exemplos&lt;/a&gt; e &lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-6.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 6&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Tabela Produto&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdProduto&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;NomeProduto&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;PrecoUnitario&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;QtdeEstoque&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;TV LCD 32&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1050.50&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;120&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;2&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;DVD&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;220.80&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;300&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Notebook i5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1300.20&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;170&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;4&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Pendrive 2MB&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;20.75&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;100&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Camera Fotografica&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;179.20&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;255&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;6&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Filmadora&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;350.77&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;75&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;7&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Blu-Ray&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;319.90&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;500&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;8&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;GPS&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;377.89&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;180&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;9&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Celular&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;89.99&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;277&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;10&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;MP3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;183.77&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;280&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
___________________________________________________________________________________&lt;br /&gt;
&lt;b style=&quot;color: #3d85c6;&quot;&gt;1.Utilizando todos os parâmetros&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Insert Into Produto (IdProduto,NomeProduto,PrecoUnitario,QtdeEstoque) Values (11,&quot;Fogão de 4 Bocas&quot;,500,300);&lt;br /&gt;
&lt;br /&gt;
___________________________________________________________________________________&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;2.Não especificando a lista de colunas e utilizando expressões&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Insert Produto Values (12,&quot;Geladeira 270 litros&quot;,500,300*5);&lt;br /&gt;
&lt;br /&gt;
Repare que neste exemplo utilizamos uma expressão para inserir o dado da coluna QtdeEstoque (300*5). &lt;br /&gt;
___________________________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Tabela Produto depois dos Inserts&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdProduto&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;NomeProduto&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;PrecoUnitario&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;QtdeEstoque&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;TV LCD 32&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1050.50&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;120&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;2&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;DVD&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;220.80&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;300&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Notebook i5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1300.20&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;170&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;4&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Pendrive 2MB&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;20.75&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;100&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Camera Fotografica&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;179.20&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;255&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;6&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Filmadora&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;350.77&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;75&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;7&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Blu-Ray&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;319.90&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;500&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;8&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;GPS&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;377.89&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;180&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;9&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Celular&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;89.99&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;277&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;10&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;MP3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;183.77&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;280&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;11&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Fogão de 4 Bocas&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;500.00&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;300&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;12&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Geladeira 270 litros&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;500.00&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1500&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
___________________________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
Por enquanto é só pessoal.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Veja também&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-1.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 1&lt;/a&gt; &lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-2.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 2&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-3.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 3&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-4.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 4&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-5.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 5&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-6.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 6&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-7.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 7&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-8.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 8&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlaprendendo.blogspot.com/feeds/3821875369007294340/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/05/manipulando-dados-insert.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/3821875369007294340'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/3821875369007294340'/><link rel='alternate' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/05/manipulando-dados-insert.html' title='Manipulando Dados - INSERT'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4036429675738629295.post-654192631661644697</id><published>2012-05-20T20:06:00.001-03:00</published><updated>2012-05-20T20:06:56.492-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Distinct"/><category scheme="http://www.blogger.com/atom/ns#" term="MySQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle"/><category scheme="http://www.blogger.com/atom/ns#" term="Order by"/><category scheme="http://www.blogger.com/atom/ns#" term="Select"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><category scheme="http://www.blogger.com/atom/ns#" term="Union"/><title type='text'>Select - Utilizando a Cláusula Union</title><content type='html'>Como combinar o resultado de duas consultas ou mais em um único resultado?&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;Para combinar duas ou mais consultas e obter um único resultado utilizamos a cláusula &lt;b&gt;UNION&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Sintaxe&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
UNION [ALL]&lt;br /&gt;
&lt;br /&gt;
UNION - Combina várias consultas em um único resultado.&lt;br /&gt;
&lt;br /&gt;
ALL- Traz todas as linhas para o resultado. Caso não seja especificado serão trazidas somente as linhas distintas. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Observações&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
1 - O número de colunas de cada Select deve ser o mesmo;&lt;br /&gt;
2 - As colunas correspondentes de cada Select devem ter seus tipos de dados compatíveis;&lt;br /&gt;
3 - Podemos utilizar ORDER BY porém somente no último Select;&lt;br /&gt;
_________________________________________________________________________________&lt;br /&gt;
&lt;b&gt;Exemplos&lt;/b&gt; &lt;br /&gt;
&lt;br /&gt;
Nos exemplos abaixo utilizaremos as tabelas criadas e populadas nos posts: &lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/tabelas-para-nossos-exemplos.html&quot; target=&quot;_blank&quot;&gt;Tabelas para nossos exemplos&lt;/a&gt; e &lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-6.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 6&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Além disso vamos criar mais duas tabelas: ProdutoA e ProdutoB&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;-- ProdutoA&lt;br /&gt;
Create table ProdutoA (IdProduto int, NomeProduto varchar(100), PrecoUnitario decimal(10,2), QtdeEstoque int);&lt;br /&gt;
&lt;br /&gt;
Insert into ProdutoA (IdProduto, NomeProduto, PrecoUnitario, QtdeEstoque) Values (1,&#39;TV LCD 40&#39;,102.50,130); &lt;br /&gt;
Insert into ProdutoA (IdProduto, NomeProduto, PrecoUnitario, QtdeEstoque) Values (2,&#39;DVD&#39;,280.80,300);&lt;br /&gt;
Insert into ProdutoA (IdProduto, NomeProduto, PrecoUnitario, QtdeEstoque) Values (3,&#39;Notebook i7&#39;,130.50,190); &lt;br /&gt;
Insert into ProdutoA (IdProduto, NomeProduto, PrecoUnitario, QtdeEstoque) Values (4,&#39;Pendrive 2MB&#39;,20.75,100);&lt;br /&gt;
Insert into ProdutoA (IdProduto, NomeProduto, PrecoUnitario, QtdeEstoque) Values (5,&#39;Camera Fotografica&#39;,179.20,255);&lt;br /&gt;
&lt;br /&gt;
-- ProdutoB &lt;br /&gt;
Create table ProdutoB (IdProduto int, NomeProduto varchar(100), PrecoUnitario decimal(10,2), QtdeEstoque int);&lt;br /&gt;
&lt;br /&gt;
Insert into ProdutoB (IdProduto, NomeProduto, PrecoUnitario, QtdeEstoque) Values (10,&#39;Filmadora&#39;,350.77,75);&lt;br /&gt;
Insert into ProdutoB (IdProduto, NomeProduto, PrecoUnitario, QtdeEstoque) Values (20,&#39;iPhone&#39;,319.90,500);&lt;br /&gt;
Insert into ProdutoB (IdProduto, NomeProduto, PrecoUnitario, QtdeEstoque) Values (28,&#39;iPod&#39;,77.89,180);&lt;br /&gt;
Insert into ProdutoB (IdProduto, NomeProduto, PrecoUnitario, QtdeEstoque) Values (39,&#39;Geladeira&#39;,489.99,277);&lt;br /&gt;
Insert into ProdutoB (IdProduto, NomeProduto, PrecoUnitario, QtdeEstoque) Values (110,&#39;Fogão&#39;,283.77,280);&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Tabela Produto&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;NomeProduto&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;TV LCD 32&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;DVD&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Notebook i5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Pendrive 2MB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Camera Fotografica&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Filmadora&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Blu-Ray&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;GPS&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Celular&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;MP3&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;b&gt;Tabela Produto A&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;NomeProduto&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;TV LCD 40&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;DVD&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Notebook i7&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Pendrive 2MB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Camera Fotografica&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Tabela Produto B &lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;NomeProduto&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Filmadora&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;iPhone&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;iPod&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Geladeira&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Fogão&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
_________________________________________________________________________________&lt;br /&gt;
&lt;b&gt;Exemplos&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: #3d85c6;&quot;&gt;
&lt;b&gt;1.Selecionando todas as linhas das tabelas Produto, ProdutoA e ProdutoB&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
Select NomeProduto,&#39;Tabela Produto&#39; as Tabela&amp;nbsp; From blog.Produto&lt;br /&gt;
Union All&lt;br /&gt;
Select NomeProduto,&#39;Tabela ProdutoA&#39; as Tabela From blog.ProdutoA&lt;br /&gt;
Union All&lt;br /&gt;
Select NomeProduto,&#39;Tabela ProdutoB&#39; as Tabela From blog.ProdutoB;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;NomeProduto&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Tabela&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;TV LCD 32&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Tabela Produto&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;DVD&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Tabela Produto&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Notebook i5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Tabela Produto&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Pendrive 2MB&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Tabela Produto&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Camera Fotografica&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Tabela Produto&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Filmadora&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Tabela Produto&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Blu-Ray&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Tabela Produto&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;GPS&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Tabela Produto&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Celular&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Tabela Produto&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;MP3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Tabela Produto&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;TV LCD 40&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Tabela ProdutoA&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;DVD&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Tabela ProdutoA&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Notebook i7&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Tabela ProdutoA&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Pendrive 2MB&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Tabela ProdutoA&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Camera Fotografica&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Tabela ProdutoA&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Filmadora&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Tabela ProdutoB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;iPhone&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Tabela ProdutoB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;iPod&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Tabela ProdutoB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Geladeira&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Tabela ProdutoB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Fogão&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Tabela ProdutoB&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
Neste exemplo foi criada uma coluna chamada &quot;Tabela&quot; para sabermos qual é a tabela de origem de cada produto.&amp;nbsp; &lt;br /&gt;
_________________________________________________________________________________&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;2.Selecionando e ordenando produtos distintos &lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp;&lt;/b&gt; &lt;br /&gt;
Select NomeProduto as Tabela&amp;nbsp; From Produto&lt;br /&gt;
Union &lt;br /&gt;
Select NomeProduto as Tabela From ProdutoA&lt;br /&gt;
Union &lt;br /&gt;
Select NomeProduto as Tabela From ProdutoB Order by 1;&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Tabela&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Blu-Ray&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Camera Fotografica&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Celular&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;DVD&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Filmadora&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Fogão&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Geladeira&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;GPS&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;iPhone&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;iPod&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;MP3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Notebook i5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Notebook i7&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Pendrive 2MB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;TV LCD 32&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;TV LCD 40&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
Neste exemplo não utilizamos a cláusula ALL, com isso o resultado final possuí os produtos sem duplicidade. Também foi utilizado um ORDER BY - repare que o ORDER BY foi colocado no último Select.&lt;br /&gt;
_________________________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
Por enquanto é só pessoal.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Veja também&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-1.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 1&lt;/a&gt; &lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-2.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 2&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-3.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 3&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-4.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 4&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-5.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 5&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-6.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 6&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-7.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 7&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-8.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 8&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlaprendendo.blogspot.com/feeds/654192631661644697/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/05/select-utilizando-clausula-union.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/654192631661644697'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/654192631661644697'/><link rel='alternate' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/05/select-utilizando-clausula-union.html' title='Select - Utilizando a Cláusula Union'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4036429675738629295.post-6805117133842052427</id><published>2012-05-20T11:37:00.000-03:00</published><updated>2012-05-20T11:37:29.593-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="LIKE"/><category scheme="http://www.blogger.com/atom/ns#" term="MySQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle"/><category scheme="http://www.blogger.com/atom/ns#" term="Select"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><title type='text'>Select Básico - Parte 8</title><content type='html'>Neste post vamos fazer sobre o operador &lt;b&gt;LIKE&lt;/b&gt;.&lt;br /&gt;
&lt;div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;Com o operador &lt;b&gt;LIKE &lt;/b&gt;conseguimos fazer comparações mais elaboradas entre cadeias caracteres.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Sintaxe&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;expressão principal&lt;/b&gt;&lt;/i&gt; [NOT]&amp;nbsp;&lt;b&gt;LIKE &lt;/b&gt;&lt;i&gt;expressão a ser pesquisada&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;expressão principal&lt;/b&gt; -&lt;/i&gt;&amp;nbsp;É a qualquer expressão caractere válida. Esta expressão sofrerá a pesquisa.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;expressão a ser pesquisada&lt;/b&gt; - &lt;/i&gt;É a expressão caractere que será pesquisada na &lt;i&gt;expressão principal&lt;/i&gt;. Nesta expressão podemos utilizar os caracteres coringa.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 314px;&quot;&gt;&lt;colgroup&gt;&lt;col style=&quot;mso-width-alt: 4278; mso-width-source: userset; width: 88pt;&quot; width=&quot;117&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 7204; mso-width-source: userset; width: 148pt;&quot; width=&quot;197&quot;&gt;&lt;/col&gt;
 &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td height=&quot;20&quot; style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: .5pt solid white; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 88pt;&quot; width=&quot;117&quot;&gt;&lt;b&gt;Caractere Coringa&lt;/b&gt;&lt;/td&gt;
  &lt;td style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: none; border-top: .5pt solid white; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 148pt;&quot; width=&quot;197&quot;&gt;&lt;b&gt;Descrição&lt;/b&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td height=&quot;20&quot; style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;%&lt;/td&gt;
  &lt;td style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: none; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;Qualquer cadeia de
  caracteres&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td height=&quot;20&quot; style=&quot;background: #B8CCE4; border-bottom: none; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;_
  (sublinhado)&lt;/td&gt;
  &lt;td style=&quot;background: #B8CCE4; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;Qualquer caractere únic&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
_____________________________________________________________________________________&lt;br /&gt;
&lt;b&gt;Exemplos&lt;/b&gt; &lt;br /&gt;
&lt;br /&gt;
Nos exemplos abaixo utilizaremos as tabelas criadas e populadas nos posts: &lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/tabelas-para-nossos-exemplos.html&quot; target=&quot;_blank&quot;&gt;Tabelas para nossos exemplos&lt;/a&gt; e &lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-6.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 6&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: #3d85c6;&quot;&gt;
&lt;b&gt;1.Selecionando funcionários comecem com a letra &quot;J&quot;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
Select IdFuncionario,Nome,Bairro,Cidade from Funcionario where Nome like &#39;J%&#39;;&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdFuncionario&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Nome&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Bairro&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Cidade&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Joaquim José&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Geraldo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Paulo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;9&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;José Maria&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Vila Verde&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Fortaleza&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;12&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Josefa Cristina&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Perdizes&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Pederneiras&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
_____________________________________________________________________________________&lt;br /&gt;
&lt;div style=&quot;color: #3d85c6;&quot;&gt;
&lt;b&gt;2.Selecionando funcionários terminem com a letra &quot;A&quot;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
Select IdFuncionario,Nome,Bairro,Cidade from Funcionario where Nome like &#39;%A&#39;;&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdFuncionario&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Nome&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Bairro&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Cidade&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;2&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Pedro Silva&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Geraldo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Paulo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Maria Aparecida&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Geraldo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Paulo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;7&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Diana Cristina&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Geraldo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Paulo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;9&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;José Maria&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Vila Verde&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Fortaleza&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;10&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Paula Silva&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Penha&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Rio de Janeiro&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;12&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Josefa Cristina&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Perdizes&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Pederneiras&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;13&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Carla Maria&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Morumbi&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Agudos&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
_____________________________________________________________________________________&lt;br /&gt;
&lt;div style=&quot;color: #3d85c6;&quot;&gt;
&lt;b&gt;3.Selecionando funcionários que possuam a letra &quot;M&quot; em qualquer parte do nome&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;Select IdFuncionario,Nome,Bairro,Cidade from Funcionario where Nome like &#39;%M%&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdFuncionario&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Nome&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Bairro&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Cidade&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Joaquim José&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Geraldo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Paulo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Mário Mattos&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Geraldo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Paulo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;4&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Manuel Antônio&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Geraldo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Paulo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Maria Aparecida&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Geraldo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Paulo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;8&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Miriam Lagos&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Geraldo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Paulo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;9&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;José Maria&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Vila Verde&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Fortaleza&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;13&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Carla Maria&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Morumbi&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Agudos&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
_____________________________________________________________________________________&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;color: #3d85c6;&quot;&gt;
&lt;b&gt;4.Selecionando funcionários cuja penúltima letra seja &quot;O&quot;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
Select IdFuncionario,Nome,Bairro,Cidade from Funcionario where Nome like &#39;%O_&#39;;&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdFuncionario&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Nome&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Bairro&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Cidade&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Mário Mattos&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Geraldo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Paulo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;8&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Miriam Lagos&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Geraldo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Paulo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;11&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Vanderlei Santos&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Tatuape&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Guarulhos&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
_____________________________________________________________________________________&lt;br /&gt;
&lt;div style=&quot;color: #3d85c6;&quot;&gt;
&lt;b&gt;5.Selecionando funcionários cuja segunda letra seja &quot;A&quot;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
Select IdFuncionario,Nome,Bairro,Cidade from Funcionario where Nome like &#39;_A%&#39;;&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdFuncionario&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Nome&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Bairro&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Cidade&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Mário Mattos&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Geraldo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Paulo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;4&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Manuel Antônio&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Geraldo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Paulo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Maria Aparecida&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Geraldo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Paulo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;6&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Daniel Borges&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Geraldo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Paulo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;10&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Paula Silva&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Penha&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Rio de Janeiro&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;11&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Vanderlei Santos&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Tatuape&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Guarulhos&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;13&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Carla Maria&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Morumbi&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Agudos&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
_____________________________________________________________________________________&lt;br /&gt;
Por enquanto é só pessoal.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Veja também&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-1.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 1&lt;/a&gt; &lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-2.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 2&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-3.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 3&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-4.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 4&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-5.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 5&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-6.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 6&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-7.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 7&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlaprendendo.blogspot.com/feeds/6805117133842052427/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/05/select-basico-parte-8.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/6805117133842052427'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/6805117133842052427'/><link rel='alternate' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/05/select-basico-parte-8.html' title='Select Básico - Parte 8'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4036429675738629295.post-314381385622312718</id><published>2012-05-19T22:23:00.001-03:00</published><updated>2012-05-19T22:25:15.552-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="MySQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle"/><category scheme="http://www.blogger.com/atom/ns#" term="Order by"/><category scheme="http://www.blogger.com/atom/ns#" term="Select"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><title type='text'>Select Básico - Parte 7</title><content type='html'>Como ordenar o resultado de uma consulta SQL?&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;Para ordenar o resultado de uma consulta SQL basta utilizarmos a cláusula &lt;b&gt;Order by&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Sintaxe&lt;/b&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;ORDER BY&lt;/b&gt; &lt;i&gt;expressão_order_by&lt;/i&gt; &lt;b&gt;[ ASC | DESC ] &lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;expressão_order_by&lt;/i&gt;&lt;/b&gt; - epecifica qual coluna ou expressão da consulta deve ser ordenada. Ao invés de usar o nome de uma coluna podemos usar um número inteiro positivo que representa a posição da coluna na lista de seleção.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;ASC | DESC&lt;/b&gt; - indica se a coluna deve ser ordenada de maneira ascendente (ASC) ou descendente (DESC). O padrão é a ordenação ascendente.&lt;br /&gt;
___________________________________________________________________________________&lt;br /&gt;
Nos exemplos abaixo utilizaremos as tabelas criadas e populadas nos posts: &lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/tabelas-para-nossos-exemplos.html&quot; target=&quot;_blank&quot;&gt;Tabelas para nossos exemplos&lt;/a&gt; e &lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-6.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 6&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: #3d85c6;&quot;&gt;
&lt;b&gt;1.Ordenando a tabela Funcionario pelo nome de forma ascendente&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
Select IdFuncionario,Nome,Cidade,UF from Funcionario Order by Nome;&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdFuncionario&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Nome&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Cidade&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;UF&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;13&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Carla Maria&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Agudos&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;RJ&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;6&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Daniel Borges&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Paulo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;7&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Diana Cristina&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Paulo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Joaquim José&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Paulo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;9&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;José Maria&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Fortaleza&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;CE&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;12&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Josefa Cristina&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Pederneiras&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;AM&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;4&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Manuel Antônio&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Paulo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Maria Aparecida&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Paulo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Mário Mattos&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Paulo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;8&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Miriam Lagos&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Paulo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;10&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Paula Silva&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Rio de Janeiro&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;RJ&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;2&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Pedro Silva&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Paulo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;11&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Vanderlei Santos&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Guarulhos&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
___________________________________________________________________________________&lt;br /&gt;
&lt;div style=&quot;color: #3d85c6;&quot;&gt;
&lt;b&gt;2.Ordenando a tabela Funcionario pelo nome de forma descendente&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
Select IdFuncionario,Nome,Cidade,UF from Funcionario Order by 2 Desc;&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdFuncionario&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Nome&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Cidade&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;UF&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;11&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Vanderlei Santos&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Guarulhos&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;2&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Pedro Silva&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Paulo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;10&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Paula Silva&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Rio de Janeiro&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;RJ&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;8&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Miriam Lagos&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Paulo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Mário Mattos&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Paulo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Maria Aparecida&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Paulo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;4&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Manuel Antônio&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Paulo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;12&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Josefa Cristina&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Pederneiras&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;AM&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;9&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;José Maria&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Fortaleza&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;CE&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Joaquim José&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Paulo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;7&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Diana Cristina&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Paulo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;6&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Daniel Borges&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Paulo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;13&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Carla Maria&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Agudos&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;RJ&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
No exemplo acima utilizamos o número 2 no lugar do nome do funcionário para fazer a ordenação.&lt;br /&gt;
___________________________________________________________________________________&lt;br /&gt;
&lt;div style=&quot;color: #3d85c6;&quot;&gt;
&lt;b&gt;3.Utilizando expressões para ordenar &lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;Select IdProduto,NomeProduto,PrecoUnitario,QtdeEstoque,PrecoUnitario * QtdeEstoque as ValorEsqoue from Produto Order by PrecoUnitario * QtdeEstoque Desc;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdProduto&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;NomeProduto&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;PrecoUnitario&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;QtdeEstoque&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;ValorEsqoue&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Notebook i5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1300.20&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;170&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;221034.00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;7&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Blu-Ray&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;319.90&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;500&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;159950.00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;TV LCD 32&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1050.50&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;120&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;126060.00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;8&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;GPS&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;377.89&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;180&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;68020.20&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;2&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;DVD&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;220.80&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;300&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;66240.00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;10&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;MP3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;183.77&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;280&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;51455.60&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Camera Fotografica&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;179.20&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;255&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;45696.00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;6&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Filmadora&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;350.77&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;75&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;26307.75&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;9&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Celular&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;89.99&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;277&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;24927.23&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;4&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Pendrive 2MB&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;20.75&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;100&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;2075.00&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
___________________________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
Por enquanto é só pessoal.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Veja também&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-1.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 1&lt;/a&gt; &lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-2.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 2&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-3.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 3&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-4.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 4&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-5.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 5&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-6.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 6&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlaprendendo.blogspot.com/feeds/314381385622312718/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/05/select-basico-parte-7.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/314381385622312718'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/314381385622312718'/><link rel='alternate' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/05/select-basico-parte-7.html' title='Select Básico - Parte 7'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4036429675738629295.post-8507407007883717523</id><published>2012-05-19T09:11:00.000-03:00</published><updated>2012-05-19T22:15:02.830-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Distinct"/><category scheme="http://www.blogger.com/atom/ns#" term="MySQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle"/><category scheme="http://www.blogger.com/atom/ns#" term="Select"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><title type='text'>Select Básico - Parte 6</title><content type='html'>Neste post vamos falar sobre a cláusula &lt;b&gt;DISTINCT&lt;/b&gt;.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;Para começar vamos incluir algumas linhas na tabela Funcionario (ver &lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/tabelas-para-nossos-exemplos.html&quot; target=&quot;_blank&quot;&gt;Tabelas para nossos exemplos&lt;/a&gt;):&lt;br /&gt;
&lt;br /&gt;
Insert Into Funcionario &lt;br /&gt;
(IdFuncionario,Nome,DDD,Fone,Email,IdDepto,Logradouro,NrLogradouro,ComplementoEndereco,Bairro,Cidade,UF,CEP)&lt;br /&gt;
Values&lt;br /&gt;
&amp;nbsp;(9,&#39;José Maria&#39;,&#39;11&#39;,&#39;99999999&#39;,&#39;jm@xpto.com&#39;,1,&#39;R ZZZZZ&#39;,&#39;55&#39;,&#39;&#39;,&#39;Vila Verde&#39;,&#39;Fortaleza&#39;,&#39;CE&#39;,&#39;12345678&#39;),&lt;br /&gt;
&amp;nbsp;(10,&#39;Paula Silva&#39;,&#39;12&#39;,&#39;10101010&#39;,&#39;ps@xpto.com&#39;,2,&#39;Av KKKKK&#39;,&#39;20&#39;,&#39;&#39;,&#39;Penha&#39;,&#39;Rio de Janeiro&#39;,&#39;RJ&#39;,&#39;11111111&#39;),&lt;br /&gt;
&amp;nbsp;(11,&#39;Vanderlei Santos&#39;,&#39;13&#39;,&#39;51515151&#39;,&#39;vs@xpto.com&#39;,3,&#39;R XXXX&#39;,&#39;23&#39;,&#39;&#39;,&#39;Tatuape&#39;,&#39;Guarulhos&#39;,&#39;SP&#39;,&#39;22222222&#39;),&lt;br /&gt;
&amp;nbsp;(12,&#39;Josefa Cristina&#39;,&#39;41&#39;,&#39;78787878&#39;,&#39;jc@xpto.com&#39;,4,&#39;R YYYYY&#39;,&#39;77&#39;,&#39;&#39;,&#39;Perdizes&#39;,&#39;Pederneiras&#39;,&#39;AM&#39;,&#39;33333333&#39;),&lt;br /&gt;
&amp;nbsp;(13,&#39;Carla Maria&#39;,&#39;21&#39;,&#39;97979797&#39;,&#39;cm@xpto.com&#39;,5,&#39;R XYZ&#39;,&#39;99&#39;,&#39;&#39;,&#39;Morumbi&#39;,&#39;Agudos&#39;,&#39;RJ&#39;,&#39;66666666&#39;);&lt;br /&gt;
___________________________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
Vejamos o resultado do &lt;b&gt;Select &lt;/b&gt;abaixo:&lt;br /&gt;
&lt;br /&gt;
Select bairro, cidade, uf from Funcionario; &lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;bairro&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;cidade&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;uf&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Geraldo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Paulo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Geraldo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Paulo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Geraldo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Paulo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Geraldo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Paulo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Geraldo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Paulo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Geraldo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Paulo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Geraldo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Paulo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Geraldo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Paulo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Vila Verde&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Fortaleza&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;CE&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Penha&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Rio de Janeiro&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;RJ&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Tatuape&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Guarulhos&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Perdizes&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Pederneiras&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;AM&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Morumbi&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Agudos&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;RJ&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
Reparem que as oito primeiras linhas se repetem. Mas como fazer para que só apareçam linhas distintas em nossa consulta?&lt;br /&gt;
&lt;br /&gt;
A resposta é simples basta utilzarmos a cláusula &lt;b&gt;DISTINCT&lt;/b&gt;. A cláusula &lt;b&gt;DISTINCT &lt;/b&gt;serve para eliminar as linhas repetidas de uma instrução &lt;b&gt;Select&lt;/b&gt;.&lt;br /&gt;
___________________________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
&lt;b style=&quot;color: #3d85c6;&quot;&gt;1.Eliminando linhas repetidas&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Select Distinct bairro, cidade, uf from Funcionario;&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;bairro&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;cidade&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;uf&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Geraldo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Sao Paulo&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Vila Verde&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Fortaleza&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;CE&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Penha&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Rio de Janeiro&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;RJ&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Tatuape&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Guarulhos&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Perdizes&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Pederneiras&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;AM&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Morumbi&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Agudos&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;RJ&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
___________________________________________________________________________________&lt;br /&gt;
&lt;b style=&quot;color: #3d85c6;&quot;&gt;2.Selecionando UFs distintas &lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Select Distinct uf from Funcionario;&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;uf&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;CE&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;RJ&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;AM&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
___________________________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
Por enquanto é só pessoal.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Veja também&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-1.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 1&lt;/a&gt; &lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-2.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 2&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-3.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 3&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-4.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 4&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-5.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 5&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlaprendendo.blogspot.com/feeds/8507407007883717523/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/05/select-basico-parte-6.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/8507407007883717523'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/8507407007883717523'/><link rel='alternate' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/05/select-basico-parte-6.html' title='Select Básico - Parte 6'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4036429675738629295.post-4597137254242420695</id><published>2012-05-15T08:00:00.000-03:00</published><updated>2012-05-19T22:16:23.450-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="MySQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Operador Aritimético"/><category scheme="http://www.blogger.com/atom/ns#" term="Operador Lógico"/><category scheme="http://www.blogger.com/atom/ns#" term="Operador Matemático"/><category scheme="http://www.blogger.com/atom/ns#" term="Operador Relacional"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle"/><category scheme="http://www.blogger.com/atom/ns#" term="SGDB"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><title type='text'>Select Básico - Parte 5</title><content type='html'>Que tal falarmos um pouco sobre &lt;b&gt;operadores matématicos&lt;/b&gt;?&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;Na linguagem SQL padrão temos poucos operadores matemáticos. O que acontece é que cada SGDB acaba suprindo esta lacuna com funções específicas, falaremos somente sobre os operadores padrão.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Operadores Matemáticos&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 452px;&quot;&gt;&lt;colgroup&gt;&lt;col style=&quot;mso-width-alt: 7058; mso-width-source: userset; width: 145pt;&quot; width=&quot;193&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 9472; mso-width-source: userset; width: 194pt;&quot; width=&quot;259&quot;&gt;&lt;/col&gt;
 &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td class=&quot;xl65&quot; height=&quot;20&quot; style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: .5pt solid white; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 145pt;&quot; width=&quot;193&quot;&gt;&lt;b&gt;&lt;span data-guid=&quot;4b583376b2767b923c3e1da60d10de59&quot; data-source=&quot;Operator&quot;&gt;Operador&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: none; border-top: .5pt solid white; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 194pt;&quot; width=&quot;259&quot;&gt;&lt;b&gt;Função&lt;/b&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td class=&quot;xl65&quot; height=&quot;20&quot; style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;+&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: none; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;Soma&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td class=&quot;xl65&quot; height=&quot;20&quot; style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;&lt;span data-guid=&quot;f2f990f68492c267bd285d13e3e829b6&quot; data-source=&quot;Meaning&quot;&gt;-&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: none; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;Subtração&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td class=&quot;xl65&quot; height=&quot;20&quot; style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;*&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: none; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;Multiplicação&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td class=&quot;xl65&quot; height=&quot;20&quot; style=&quot;background: #B8CCE4; border-bottom: none; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;&lt;span data-guid=&quot;99ec8468a9c7cce05f22531d2545214f&quot; data-source=&quot;+ (Add)&quot;&gt;/&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #B8CCE4; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;Divisão&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
____________________________________________________________________________________&lt;br /&gt;
&lt;b&gt;Exemplos&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Primeiro vamos criar uma tabela para utilizar em nossos exemplos:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: #3d85c6;&quot;&gt;
-- Cria Tabela Produto&lt;/div&gt;
Create table Produto (IdProduto int, NomeProduto varchar(100), PrecoUnitario decimal(10,2), QtdeEstoque int);&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;-- Inclui dados&lt;/span&gt;&lt;br /&gt;
Insert into Produto (IdProduto, NomeProduto, PrecoUnitario, QtdeEstoque) Values (1,&#39;TV LCD 32&#39;,1250.50,120); &lt;br /&gt;
Insert into Produto (IdProduto, NomeProduto, PrecoUnitario, QtdeEstoque) Values (2,&#39;DVD&#39;,220.80,300);&lt;br /&gt;
Insert into Produto (IdProduto, NomeProduto, PrecoUnitario, QtdeEstoque) Values (3,&#39;Notebook i5&#39;,1300.20,170); &lt;br /&gt;
Insert into Produto (IdProduto, NomeProduto, PrecoUnitario, QtdeEstoque) Values (4,&#39;Pendrive 2MB&#39;,20.75,100);&lt;br /&gt;
Insert into Produto (IdProduto, NomeProduto, PrecoUnitario, QtdeEstoque) Values (5,&#39;Camera Fotografica&#39;,179.20,255);&lt;br /&gt;
Insert into Produto (IdProduto, NomeProduto, PrecoUnitario, QtdeEstoque) Values (6,&#39;Filmadora&#39;,350.77,75);&lt;br /&gt;
Insert into Produto (IdProduto, NomeProduto, PrecoUnitario, QtdeEstoque) Values (7,&#39;Blu-Ray&#39;,319.90,500);&lt;br /&gt;
Insert into Produto (IdProduto, NomeProduto, PrecoUnitario, QtdeEstoque) Values (8,&#39;GPS&#39;,377.89,180);&lt;br /&gt;
Insert into Produto (IdProduto, NomeProduto, PrecoUnitario, QtdeEstoque) Values (9,&#39;Celular&#39;,89.99,277);&lt;br /&gt;
Insert into Produto (IdProduto, NomeProduto, PrecoUnitario, QtdeEstoque) Values (10,&#39;MP3&#39;,183.77,280);&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Tabela Produto&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdProduto&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;NomeProduto&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;PrecoUnitario&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;QtdeEstoque&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;TV LCD 32&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1050.50&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;120&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;2&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;DVD&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;220.80&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;300&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Notebook i5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1300.20&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;170&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;4&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Pendrive 2MB&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;20.75&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;100&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Camera Fotografica&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;179.20&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;255&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;6&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Filmadora&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;350.77&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;75&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;7&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Blu-Ray&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;319.90&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;500&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;8&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;GPS&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;377.89&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;180&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;9&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Celular&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;89.99&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;277&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;10&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;MP3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;183.77&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;280&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
___________________________________________________________________________________&lt;br /&gt;
&lt;div style=&quot;color: #3d85c6;&quot;&gt;
&lt;b&gt;1.Acrescentando 10% sobre preço unitário dos produtos cuja quantidade de estoque for maior que 200&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
Select&lt;br /&gt;
&amp;nbsp; NomeProduto,&lt;br /&gt;
&amp;nbsp; PrecoUnitario,&lt;br /&gt;
&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;PrecoUnitario * 1.1&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;AS&lt;/span&gt; &lt;span style=&quot;color: #0b5394;&quot;&gt;PrecoUnitarioReajustado&lt;/span&gt;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp; QtdeEstoque&lt;br /&gt;
From Produto where QtdeEstoque &amp;gt; 200;&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;NomeProduto&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;PrecoUnitario&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;PrecoUnitarioReajustado&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;QtdeEstoque&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;DVD&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;220.80&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;242.880&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;300&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Camera Fotografica&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;179.20&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;197.120&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;255&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Blu-Ray&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;319.90&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;351.890&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;500&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Celular&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;89.99&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;98.989&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;277&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;MP3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;183.77&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;202.147&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;280&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
Neste exemplo criamos uma coluna calculada chamada &lt;span style=&quot;color: red;&quot;&gt;PrecoUnitarioReajustado&lt;/span&gt;. Repare que após a expressão&lt;span style=&quot;color: #3d85c6;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;PrecoUnitario * 1.1&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;utilizamos &lt;b&gt;&#39;AS&#39;&lt;/b&gt; que indica que &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;PrecoUnitarioReajustado &lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;é um &lt;i&gt;alias &lt;/i&gt;(apelido para coluna)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;, podemos criar apelidos para qualquer coluna.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;___________________________________________________________________________________ &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;color: #3d85c6;&quot;&gt;
&lt;b&gt;2.Utizando expressões matemáticas na cláusula WHERE&lt;/b&gt;&lt;/div&gt;
Select&lt;br /&gt;
&amp;nbsp; NomeProduto,&lt;br /&gt;
&amp;nbsp; PrecoUnitario,&lt;br /&gt;
&amp;nbsp; &lt;span style=&quot;color: #0b5394;&quot;&gt;PrecoUnitario * 1.1 &lt;/span&gt;AS &lt;span style=&quot;color: #0b5394;&quot;&gt;PrecoUnitarioReajustado&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp; QtdeEstoque&lt;br /&gt;
From Produto where &lt;span style=&quot;color: #0b5394;&quot;&gt;PrecoUnitario * 1.1&lt;/span&gt; &amp;gt; 400;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;NomeProduto&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;PrecoUnitario&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;PrecoUnitarioReajustado&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;QtdeEstoque&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;TV LCD 32&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1050.50&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1155.550&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;120&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Notebook i5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1300.20&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1430.220&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;170&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;GPS&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;377.89&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;415.679&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;180&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
No exemplo acima utilizamos a mesma expressão matemática da coluna &lt;span style=&quot;color: #0b5394;&quot;&gt;PrecoUnitarioReajustado&lt;/span&gt; na cláusula WHERE, para selecionar produtos que tenham preço unitário acrescido de 10%&amp;nbsp; maior que 400.&lt;br /&gt;
___________________________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: #3d85c6;&quot;&gt;
&lt;b&gt;3.Precedência dos operadores&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3d85c6;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3d85c6;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;Temos que levar em consideração que os operadores possuem a seguinte precedência na realização dos cáculos: *, /, + e -. Podemos mudar a ordem disto com a utilização de parênteses.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3d85c6;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3d85c6;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;Veja o exemplo abaixo:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3d85c6;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Select&lt;br /&gt;
&amp;nbsp; NomeProduto,&lt;br /&gt;
&amp;nbsp; PrecoUnitario,&lt;br /&gt;
&amp;nbsp; &lt;span style=&quot;color: #3d85c6;&quot;&gt;PrecoUnitario + 5 * 1.1&lt;/span&gt;&amp;nbsp; AS &lt;span style=&quot;color: #3d85c6;&quot;&gt;Reajuste1&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp; &lt;span style=&quot;color: #3d85c6;&quot;&gt;(PrecoUnitario + 5) * 1.1&lt;/span&gt; AS &lt;span style=&quot;color: #3d85c6;&quot;&gt;Reajuste2&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp; QtdeEstoque&lt;br /&gt;
From Produto&lt;br /&gt;
Where NomeProduto In (&#39;DVD&#39;,&#39;GPS&#39;);&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;NomeProduto&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;PrecoUnitario&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Reajuste1&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Reajuste2&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;QtdeEstoque&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;DVD&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;220.80&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;226.30&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;248.380&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;300&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;GPS&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;377.89&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;383.39&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;421.179&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;180&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
Verifique que o cálculo da coluna &lt;span style=&quot;color: #3d85c6;&quot;&gt;Reajuste1 &lt;/span&gt;possuí um resultado diferente da coluna &lt;span style=&quot;color: #3d85c6;&quot;&gt;Reajuste2&lt;/span&gt;.&lt;br /&gt;
O cálculo das colunas é feito da seguinte maneira:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; - &lt;span style=&quot;color: #3d85c6;&quot;&gt;Reajuste1 &lt;/span&gt;= 5 * 1.1 e depois soma-se o PrecoUnitario&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; Equanto:&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp;- &lt;span style=&quot;color: #3d85c6;&quot;&gt;Reajuste2 &lt;/span&gt;= (PrecoUnitario + 5) e depois multiplica-se por 1.1&lt;br /&gt;
___________________________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
Por enquanto é isso pessoal.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Veja também&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-1.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 1&lt;/a&gt; &lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-2.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 2&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-3.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 3&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-4.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 4&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-6.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 6&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlaprendendo.blogspot.com/feeds/4597137254242420695/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/05/select-basico-parte-5.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/4597137254242420695'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/4597137254242420695'/><link rel='alternate' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/05/select-basico-parte-5.html' title='Select Básico - Parte 5'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4036429675738629295.post-1988392873463971183</id><published>2012-05-14T10:00:00.000-03:00</published><updated>2012-05-19T22:17:32.773-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="and"/><category scheme="http://www.blogger.com/atom/ns#" term="in"/><category scheme="http://www.blogger.com/atom/ns#" term="MySQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Operador Lógico"/><category scheme="http://www.blogger.com/atom/ns#" term="Operador Relacional"/><category scheme="http://www.blogger.com/atom/ns#" term="or"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle"/><category scheme="http://www.blogger.com/atom/ns#" term="Select"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><title type='text'>Select Básico - Parte 4</title><content type='html'>Continuando nossa série de posts sobre &lt;b&gt;Select &lt;/b&gt;vamos falar um pouco sobre o operador &lt;b&gt;IN&lt;/b&gt;.&lt;br /&gt;
&lt;div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;div&gt;
&lt;b&gt;Sintaxe&lt;/b&gt;&amp;nbsp;&lt;b&gt;IN&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;expressão_teste&amp;nbsp;&lt;/i&gt;&lt;b&gt;[not]&lt;/b&gt;&amp;nbsp;&amp;nbsp;&lt;b&gt;in &lt;/b&gt;( &amp;nbsp;&lt;i&gt;subquery &lt;/i&gt;| &lt;i&gt;expressão &lt;/i&gt;[ ,..., n] )&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;expressão_teste - &lt;/i&gt;Qualquer&amp;nbsp;expressão válida&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
not - Indica&amp;nbsp;que o resultado do predicado deve ser invertido.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;subquery&lt;/i&gt; - É uma &lt;i&gt;subconsulta &lt;/i&gt;que possuí como resultado uma coluna que server para testar se um dos&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; valores corresponde&amp;nbsp;a&amp;nbsp;&lt;i&gt;expressão_teste&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;expressão&lt;/i&gt;&amp;nbsp;- É uma lista de expressões para testar se um dos valores corresponde a &lt;i&gt;expressão_teste&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;Observação&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;expressão_teste&lt;/i&gt;,&amp;nbsp;
&lt;i&gt;subquery&lt;/i&gt;&amp;nbsp;&amp;nbsp;e&amp;nbsp;
&lt;i&gt;expressão&lt;/i&gt;&amp;nbsp;&amp;nbsp;devem ser do mesmo tipo.&lt;/div&gt;
&lt;br /&gt;
&lt;i&gt;_________________________________________________________________________________&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Exemplos&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;div&gt;
Nestes exemplos utilizaremos a tabela Funcionario criada no post&amp;nbsp;&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/tabelas-para-nossos-exemplos.html&quot;&gt;Tabelas para nossos exemplos&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b style=&quot;color: #3d85c6;&quot;&gt;Conteúdo parcial tabela Funcionário&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdFUncionario&lt;/td&gt;&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Nome&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Joaquim José&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;2&lt;/td&gt;&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Pedro Silva&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;3&lt;/td&gt;&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Mário Mattos&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;4&lt;/td&gt;&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Manuel Antônio&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;5&lt;/td&gt;&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Maria Aparecida&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;6&lt;/td&gt;&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Daniel Borges&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;7&lt;/td&gt;&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Diana Cristina&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;8&lt;/td&gt;&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Miriam Lagos&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
_________________________________________________________________________________&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;b style=&quot;color: #3d85c6;&quot;&gt;1.Selecionando funcionários com código de departamento igual a 1,5 e 7&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
Select IdFuncionario,Nome From Funcionario where IdDepto in (1,5,7);&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdFuncionario&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Nome&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Joaquim José&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Maria Aparecida&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;7&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Diana Cristina&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Uma outra maneira de obter o mesmo resultado acima:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Select IdFuncionario,Nome From Funcionario where IdDepto=1 or IdDepto=5 or IdDepto=7;&lt;br /&gt;
_________________________________________________________________________________&lt;br /&gt;
&lt;div&gt;
&lt;b style=&quot;color: #3d85c6;&quot;&gt;2.Selecionando funcionários com código de departamento diferente de 1,5 e 7&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
Select IdFuncionario,Nome From Funcionario where IdDepto not in (1,5,7);&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdFuncionario&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Nome&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;2&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Pedro Silva&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Mário Mattos&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;4&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Manuel Antônio&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;6&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Daniel Borges&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;8&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Miriam Lagos&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;b&gt;Uma outra maneira de obter o mesmo resultado acima:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Select IdFuncionario,Nome From Funcionario where not (IdDepto=1 or IdDepto=5 or IdDepto=7);&lt;br /&gt;
________________________________________________________________________________&lt;br /&gt;
Não falaremos agora sobre &lt;i&gt;subquerys&lt;/i&gt;, decicaremos um post somente para este assunto.&lt;br /&gt;
&lt;br /&gt;
Por enquanto é só pessoal.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Veja também&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-1.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 1&lt;/a&gt; &lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-2.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 2&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-3.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 3&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-5.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 5&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-6.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 6&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlaprendendo.blogspot.com/feeds/1988392873463971183/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/05/select-basico-parte-4.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/1988392873463971183'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/1988392873463971183'/><link rel='alternate' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/05/select-basico-parte-4.html' title='Select Básico - Parte 4'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4036429675738629295.post-5596188327755959558</id><published>2012-05-13T10:00:00.000-03:00</published><updated>2012-05-19T22:18:41.171-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="and"/><category scheme="http://www.blogger.com/atom/ns#" term="between"/><category scheme="http://www.blogger.com/atom/ns#" term="MySQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Operador Lógico"/><category scheme="http://www.blogger.com/atom/ns#" term="Operador Relacional"/><category scheme="http://www.blogger.com/atom/ns#" term="or"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle"/><category scheme="http://www.blogger.com/atom/ns#" term="Select"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><title type='text'>Select Básico - Parte 3</title><content type='html'>Vamos falar um pouco sobre o operador BETWEEN.&lt;br /&gt;
&lt;div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Sintaxe&lt;/b&gt;&amp;nbsp;&lt;b&gt;BETWEEN&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;expressão_teste&amp;nbsp;&lt;/i&gt;&lt;b&gt;[not]&lt;/b&gt;&amp;nbsp;
&lt;b&gt;between&amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;i&gt;expressão_inicial &lt;/i&gt;&lt;b&gt;and &lt;/b&gt;&lt;i&gt;expressão_final&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;expressão_teste -&amp;nbsp;&lt;/i&gt;expressão a ser testada no intervalo de &lt;i&gt;expressão_inicial &lt;/i&gt;e &lt;i&gt;expressão_final&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
not - indica&amp;nbsp;que o resultado do predicado deve ser invertido.&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;expressão_inicial&lt;/i&gt; - qualquer expressão válida&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;expressão_final&lt;/i&gt; - qualquer expressão válida&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
and - identifica em qual intervalo&amp;nbsp;&lt;i&gt;expressão_teste &lt;/i&gt;deve estar entre&amp;nbsp;&lt;i&gt;expressão_inicial&lt;/i&gt;&amp;nbsp; e&amp;nbsp;&lt;i&gt;expressão_inicial&amp;nbsp;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Observação&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;expressão_teste&lt;/i&gt;,&amp;nbsp;&lt;i&gt;expressão_inicial &lt;/i&gt;e&amp;nbsp;&lt;i&gt;expressão_final&lt;/i&gt;&amp;nbsp;devem ser do mesmo tipo.&lt;br /&gt;
_________________________________________________________________________________&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;b&gt;Exemplos&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;div&gt;
Nestes exemplos utilizaremos a tabela Funcionario criada no post&amp;nbsp;&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/tabelas-para-nossos-exemplos.html&quot;&gt;Tabelas para nossos exemplos&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b style=&quot;color: #3d85c6;&quot;&gt;Conteúdo parcial tabela Funcionário&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdFUncionario&lt;/td&gt;&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Nome&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Joaquim José&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;2&lt;/td&gt;&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Pedro Silva&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;3&lt;/td&gt;&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Mário Mattos&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;4&lt;/td&gt;&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Manuel Antônio&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;5&lt;/td&gt;&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Maria Aparecida&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;6&lt;/td&gt;&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Daniel Borges&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;7&lt;/td&gt;&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Diana Cristina&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;8&lt;/td&gt;&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Miriam Lagos&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
_________________________________________________________________________________&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;b style=&quot;color: #3d85c6;&quot;&gt;1.Selecionando funcionários cujo código esteja entre 3 e 6&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b style=&quot;color: #3d85c6;&quot;&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
Select IdFuncionario,Nome From Funcionario where IdFuncionario between 3 and 6;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdFuncionario&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Nome&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Mário Mattos&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;4&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Manuel Antônio&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Maria Aparecida&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;6&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Daniel Borges&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;b&gt;Uma outra maneira de obter o mesmo resultado acima:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Select IdFuncionario,Nome From Funcionario where IdFuncionario &amp;gt;= 3 and IdFuncionario &amp;lt;= 6;&lt;br /&gt;
&lt;br /&gt;
_________________________________________________________________________________&lt;/div&gt;
&lt;div&gt;
&lt;b style=&quot;color: #3d85c6;&quot;&gt;2.Selecionando funcionários cujo código não esteja entre 3 e 6&lt;/b&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;b style=&quot;color: #3d85c6;&quot;&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
Select IdFuncionario,Nome From Funcionario Where IdFuncionario not between 3 and 6;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdFuncionario&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Nome&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Joaquim José&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;2&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Pedro Silva&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;7&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Diana Cristina&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;8&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Miriam Lagos&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;b&gt;Uma outra maneira de obter o mesmo resultado acima:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Select IdFuncionario,Nome From Funcionario where not (IdFuncionario &amp;gt;= 3 and IdFuncionario &amp;lt;= 6);&lt;br /&gt;
________________________________________________________________________________&lt;br /&gt;
Por enquanto é só pessoal.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Veja também&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-1.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 1&lt;/a&gt; &lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-2.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 2&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-4.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 4&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-5.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 5&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-6.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 6&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlaprendendo.blogspot.com/feeds/5596188327755959558/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/05/select-basico-parte-3.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/5596188327755959558'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/5596188327755959558'/><link rel='alternate' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/05/select-basico-parte-3.html' title='Select Básico - Parte 3'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4036429675738629295.post-3205488953861280164</id><published>2012-05-12T13:12:00.001-03:00</published><updated>2012-05-19T22:18:32.058-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="and"/><category scheme="http://www.blogger.com/atom/ns#" term="MySQL"/><category scheme="http://www.blogger.com/atom/ns#" term="not"/><category scheme="http://www.blogger.com/atom/ns#" term="Operador Lógico"/><category scheme="http://www.blogger.com/atom/ns#" term="Operador Relacional"/><category scheme="http://www.blogger.com/atom/ns#" term="or"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle"/><category scheme="http://www.blogger.com/atom/ns#" term="PL/SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Select"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><category scheme="http://www.blogger.com/atom/ns#" term="Transact-SQL"/><title type='text'>Select Básico - Parte 2</title><content type='html'>Neste post vamos mostrar mais alguns exemplos sobre o comando &lt;b&gt;Select&lt;/b&gt;. Falaremos sobre o uso de operadores lógicos e relacionais.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;Operadores Relacionais&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Operadores relacionais são utilizado para fazer comparações entre valores, expressões ou funções.&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 265px;&quot;&gt;&lt;colgroup&gt;&lt;col style=&quot;mso-width-alt: 4717; mso-width-source: userset; width: 97pt;&quot; width=&quot;129&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 4973; mso-width-source: userset; width: 102pt;&quot; width=&quot;136&quot;&gt;&lt;/col&gt;
 &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td class=&quot;xl65&quot; height=&quot;20&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #b8cce4; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: solid; border-bottom-width: 0.5pt; border-left-color: initial; border-left-style: none; border-left-width: initial; border-right-color: white; border-right-style: solid; border-right-width: 0.5pt; border-top-color: white; border-top-style: solid; border-top-width: 0.5pt; color: black; font-family: Calibri; font-size: 11pt; height: 15pt; text-decoration: none; text-underline-style: none; width: 97pt;&quot; width=&quot;129&quot;&gt;&lt;b&gt;Operador&amp;nbsp;&lt;/b&gt;&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #b8cce4; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: solid; border-bottom-width: 0.5pt; border-left-color: initial; border-left-style: none; border-left-width: initial; border-right-color: initial; border-right-style: none; border-right-width: initial; border-top-color: white; border-top-style: solid; border-top-width: 0.5pt; color: black; font-family: Calibri; font-size: 11pt; text-decoration: none; text-underline-style: none; width: 102pt;&quot; width=&quot;136&quot;&gt;&lt;b&gt;Descrição&lt;/b&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td class=&quot;xl65&quot; height=&quot;20&quot; style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;&amp;lt;&amp;nbsp;&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: none; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;Menor&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td class=&quot;xl65&quot; height=&quot;20&quot; style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;&amp;gt;&amp;nbsp;&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: none; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;Maior&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td class=&quot;xl65&quot; height=&quot;20&quot; style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;&amp;lt;=&amp;nbsp;&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: none; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;Menor ou igual&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td class=&quot;xl65&quot; height=&quot;20&quot; style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;&amp;gt;=&amp;nbsp;&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: none; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;Maior ou igual&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td class=&quot;xl65&quot; height=&quot;20&quot; style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;=&amp;nbsp;&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: none; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;Igual&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td class=&quot;xl65&quot; height=&quot;20&quot; style=&quot;background: #B8CCE4; border-bottom: none; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;&amp;lt;&amp;gt;&amp;nbsp;&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background: #B8CCE4; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;Diferente&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;b&gt;Operadores Lógicos&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Os operadores lógicos avaliam a validade de condições retornando: TRUE (Verdadeiro/1), FALSE (Falso/0) ou NULL (Desconhecido/Sem Valor).&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 265px;&quot;&gt;&lt;colgroup&gt;&lt;col style=&quot;width: 97pt;&quot; width=&quot;129&quot;&gt;&lt;/col&gt;&lt;col style=&quot;width: 102pt;&quot; width=&quot;136&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;&lt;td class=&quot;xl65&quot; height=&quot;20&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #b8cce4; background-image: initial; background-origin: initial; border-bottom-color: white; border-bottom-style: solid; border-bottom-width: 0.5pt; border-left-color: initial; border-left-style: none; border-left-width: initial; border-right-color: white; border-right-style: solid; border-right-width: 0.5pt; border-top-color: white; border-top-style: solid; border-top-width: 0.5pt; font-family: Calibri; font-size: 11pt; height: 15pt; text-underline-style: none; width: 97pt;&quot; width=&quot;129&quot;&gt;&lt;b&gt;Operador&amp;nbsp;&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;xl65&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #b8cce4; background-image: initial; background-origin: initial; border-bottom-color: white; border-bottom-style: solid; border-bottom-width: 0.5pt; border-left-color: initial; border-left-style: none; border-left-width: initial; border-right-color: initial; border-right-style: none; border-right-width: initial; border-top-color: white; border-top-style: solid; border-top-width: 0.5pt; font-family: Calibri; font-size: 11pt; text-underline-style: none; width: 102pt;&quot; width=&quot;136&quot;&gt;&lt;b&gt;Descrição&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;&lt;td class=&quot;xl65&quot; height=&quot;20&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #dbe5f1; background-image: initial; background-origin: initial; border-bottom-color: white; border-bottom-style: solid; border-bottom-width: 0.5pt; border-left-color: initial; border-left-style: none; border-left-width: initial; border-right-color: white; border-right-style: solid; border-right-width: 0.5pt; border-top-color: initial; border-top-style: none; border-top-width: initial; font-family: Calibri; font-size: 11pt; height: 15pt; text-underline-style: none;&quot;&gt;And&lt;/td&gt;&lt;td class=&quot;xl65&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #dbe5f1; background-image: initial; background-origin: initial; border-bottom-color: white; border-bottom-style: solid; border-bottom-width: 0.5pt; border-left-color: initial; border-left-style: none; border-left-width: initial; border-right-color: initial; border-right-style: none; border-right-width: initial; border-top-color: initial; border-top-style: none; border-top-width: initial; font-family: Calibri; font-size: 11pt; text-underline-style: none;&quot;&gt;Retorna &lt;b&gt;TRUE&lt;/b&gt;&amp;nbsp;se as condições forem verdadeiras retorna TRUE&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;&lt;td class=&quot;xl65&quot; height=&quot;20&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #b8cce4; background-image: initial; background-origin: initial; border-bottom-color: white; border-bottom-style: solid; border-bottom-width: 0.5pt; border-left-color: initial; border-left-style: none; border-left-width: initial; border-right-color: white; border-right-style: solid; border-right-width: 0.5pt; border-top-color: initial; border-top-style: none; border-top-width: initial; font-family: Calibri; font-size: 11pt; height: 15pt; text-underline-style: none;&quot;&gt;Or&lt;/td&gt;&lt;td class=&quot;xl65&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #b8cce4; background-image: initial; background-origin: initial; border-bottom-color: white; border-bottom-style: solid; border-bottom-width: 0.5pt; border-left-color: initial; border-left-style: none; border-left-width: initial; border-right-color: initial; border-right-style: none; border-right-width: initial; border-top-color: initial; border-top-style: none; border-top-width: initial; font-family: Calibri; font-size: 11pt; text-underline-style: none;&quot;&gt;Retorna &lt;b&gt;TRUE&lt;/b&gt; se uma das condições for verdadeira retorna TRUE&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;&lt;td class=&quot;xl65&quot; height=&quot;20&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #dbe5f1; background-image: initial; background-origin: initial; border-bottom-color: white; border-bottom-style: solid; border-bottom-width: 0.5pt; border-left-color: initial; border-left-style: none; border-left-width: initial; border-right-color: white; border-right-style: solid; border-right-width: 0.5pt; border-top-color: initial; border-top-style: none; border-top-width: initial; font-family: Calibri; font-size: 11pt; height: 15pt; text-underline-style: none;&quot;&gt;Not&lt;/td&gt;&lt;td class=&quot;xl65&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #dbe5f1; background-image: initial; background-origin: initial; border-bottom-color: white; border-bottom-style: solid; border-bottom-width: 0.5pt; border-left-color: initial; border-left-style: none; border-left-width: initial; border-right-color: initial; border-right-style: none; border-right-width: initial; border-top-color: initial; border-top-style: none; border-top-width: initial; font-family: Calibri; font-size: 11pt; text-underline-style: none;&quot;&gt;Inverte o valor de retorno da condição&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;b&gt;Exemplos&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;div&gt;
Nestes exemplos utilizaremos as tabelas Funcionario e Departamento criadas no post&amp;nbsp;&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/tabelas-para-nossos-exemplos.html&quot;&gt;Tabelas para nossos exemplos&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&lt;b&gt;Conteúdo parcial tabela Funcionário&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdFUncionario&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Nome&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Joaquim José&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;2&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Pedro Silva&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Mário Mattos&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;4&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Manuel Antônio&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Maria Aparecida&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;6&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Daniel Borges&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;7&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Diana Cristina&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;8&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Miriam Lagos&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&lt;b&gt;Conteúdo tabela Departamento&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdDepto&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;NomeDepto&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Administração&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;2&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Contabilidade&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;TI&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;4&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Almoxarifado&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Segurança&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;6&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Controladoria&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;7&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Compras&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;8&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Contas a Pagar&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
_________________________________________________________________________________&lt;br /&gt;
&lt;b style=&quot;color: #3d85c6;&quot;&gt;1.Funcionários com código maior que 5&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Select IdFuncionario,Nome from Funcionario where IdFuncionario &amp;gt; 5;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdFuncionario&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Nome&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;6&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Daniel Borges&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;7&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Diana Cristina&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;8&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Miriam Lagos&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
_________________________________________________________________________________&lt;br /&gt;
&lt;b style=&quot;color: #3d85c6;&quot;&gt;2.Funcionários com código menor igual a 7&lt;/b&gt;&lt;br /&gt;
&lt;b style=&quot;color: #3d85c6;&quot;&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
Select&amp;nbsp;
IdFuncionario,Nome&amp;nbsp;&amp;nbsp;from Funcionario where IdFuncionario &amp;lt;= 7;&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdFuncionario&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Nome&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Joaquim José&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;2&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Pedro Silva&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Mário Mattos&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;4&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Manuel Antônio&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Maria Aparecida&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;6&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Daniel Borges&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;7&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Diana Cristina&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
_________________________________________________________________________________&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;3.Funcionários com UF igual a &#39;SP&#39;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Select&amp;nbsp;IdFuncionario,Nome,UF&amp;nbsp;from Funcionario where UF = &#39;SP&#39;;&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdFuncionario&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Nome&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;UF&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Joaquim José&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;2&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Pedro Silva&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Mário Mattos&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;4&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Manuel Antônio&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Maria Aparecida&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;6&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Daniel Borges&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;7&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Diana Cristina&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;8&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Miriam Lagos&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;SP&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
_________________________________________________________________________________&lt;br /&gt;
&lt;b style=&quot;color: #3d85c6;&quot;&gt;4.Departamentos com código diferente de 2&lt;/b&gt;&lt;br /&gt;
&lt;b style=&quot;color: #3d85c6;&quot;&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
Select * from Departamento where IdDepto &amp;lt;&amp;gt; 2;
&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdDepto&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;NomeDepto&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Administração&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;TI&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;4&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Almoxarifado&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Segurança&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;6&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Controladoria&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;7&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Compras&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;8&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Contas a Pagar&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
_________________________________________________________________________________&lt;br /&gt;
&lt;b style=&quot;color: #3d85c6;&quot;&gt;5.Departamentos com código maior que 1 e menor igual a 5&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Select * from Departamento where IdDepto &amp;gt; 1 and IdDepto &amp;lt;= 5;&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdDepto&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;NomeDepto&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;2&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Contabilidade&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;TI&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;4&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Almoxarifado&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Segurança&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
_________________________________________________________________________________&lt;br /&gt;
&lt;b style=&quot;color: #3d85c6;&quot;&gt;6.Departamento com código igual a 2 ou 3 ou maior que 5&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Select * from Departamento where IdDepto = 2 or IdDepto =3 or IdDepto &amp;gt;5;&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdDepto&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;NomeDepto&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;2&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Contabilidade&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;TI&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;6&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Controladoria&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;7&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Compras&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;8&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Contas a Pagar&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
_________________________________________________________________________________&lt;br /&gt;
&lt;b style=&quot;color: #3d85c6;&quot;&gt;7.Departamento com código direrente de 3 - utilizando Not &lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Select * from Departamento where Not IdDepto = 3;&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdDepto&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;NomeDepto&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Administração&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;2&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Contabilidade&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;4&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Almoxarifado&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Segurança&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;6&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Controladoria&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;7&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Compras&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;8&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Contas a Pagar&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
_________________________________________________________________________________&lt;br /&gt;
&lt;b style=&quot;color: #3d85c6;&quot;&gt;8.Utilizando parêntesis para agrupar condições&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Neste exemplo fazemos uma seleção de funcionários cujos códigos são 1 ou 3 ou que possuam o código de departamento maior igual a 6 e menor igual a 10&lt;br /&gt;
&lt;br /&gt;
Select IdFuncionario,Nome,IdDepto from Funcionario where (IdFuncionario = 1 or IdFuncionario = 3) or (IdDepto &amp;gt;= 6 and IdDepto &amp;lt;= 10);&lt;br /&gt;
&lt;br /&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdFuncionario&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Nome&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdDepto&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Joaquim José&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Mário Mattos&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;6&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Daniel Borges&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;6&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;7&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Diana Cristina&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;7&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;8&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Miriam Lagos&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;8&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
_________________________________________________________________________________&lt;br /&gt;
&lt;b style=&quot;color: #3d85c6;&quot;&gt;9.Utilizando parêntesis e not&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Neste exemplo invertemos as condições do exemplo anterior&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
Select&amp;nbsp;
IdFuncionario,Nome,IdDepto&amp;nbsp;from Funcionario where not (IdFuncionario = 1 or IdFuncionario = 3) or not (IdFuncionario &amp;gt;= 6 and IdFuncionario &amp;lt;= 10);&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;title&gt;Data&lt;/title&gt;


&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdFuncionario&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;Nome&lt;/td&gt;
&lt;td bgcolor=&quot;silver&quot; class=&quot;medium&quot;&gt;IdDepto&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Joaquim José&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;2&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Pedro Silva&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;3&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Mário Mattos&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;4&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Manuel Antônio&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;5&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Maria Aparecida&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;6&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Daniel Borges&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;6&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;7&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Diana Cristina&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;7&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;8&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;Miriam Lagos&lt;/td&gt;
&lt;td class=&quot;normal&quot; valign=&quot;top&quot;&gt;8&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Por enquanto é só. Espero que gostem.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Veja também&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-1.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 1&lt;/a&gt; &lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-3.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 3&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-4.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 4&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-5.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 5&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-6.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 6&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlaprendendo.blogspot.com/feeds/3205488953861280164/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/05/select-basico-parte-2.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/3205488953861280164'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/3205488953861280164'/><link rel='alternate' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/05/select-basico-parte-2.html' title='Select Básico - Parte 2'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4036429675738629295.post-7790123942309496940</id><published>2012-05-06T20:48:00.000-03:00</published><updated>2012-05-06T20:48:51.390-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="1FN"/><category scheme="http://www.blogger.com/atom/ns#" term="2FN"/><category scheme="http://www.blogger.com/atom/ns#" term="3FN"/><category scheme="http://www.blogger.com/atom/ns#" term="Modelo Relacional"/><category scheme="http://www.blogger.com/atom/ns#" term="Normalização"/><title type='text'>Normalização de Dados - Parte 3</title><content type='html'>&lt;b&gt;Terceira Forma Normal – 3FN&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Uma tabela está na Terceira Forma Normal (3FN) se estiver na 2FN, e 
se nenhuma coluna não pertencente a chave ficar determinada 
transitivamente por esta - dependência transitiva.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;Mas o que é dependência transitiva? Podemos dizer que dependência transitiva é indentificada quano uma coluna além de depender da chave primária, depende de outra coluna ou conjunto de colunas.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Processo para obtenção da Terceira Forma Normal (3FN)&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
1- Identificar as colunas que não participam da chave primária da tabela;&lt;br /&gt;
2- Para cada uma das colunas identificadas, analisar se seu valor é determinado por outra coluna ou conjunto de colunas;&lt;br /&gt;
3- Para as colunas dependentes transitivamente da chave&lt;br /&gt;
&amp;nbsp;&amp;nbsp; - Criar novas tabelas onde a chave primária será(ão) a(s) coluna(s) que determinou(aram) o valor da&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; coluna analisada. Agregar a essas tabelas as colunas dependentes transitivamente;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; - Excluir da tabela origem as colunas dependentes transitivamente das chaves, mantendo, porém, a&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; coluna determinante da transitividade na tabela;&lt;br /&gt;
&lt;br /&gt;
Vamos ao exemplo: &lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkbkDZ3aQehef7suwRoWc0RzdGxdQJvq6drteih3Ig-6Oylo-R4LceKmvNOOSgb4hg2XXi88AGRwl10AOWuddcwRDPJi8qjF5EG6eDGXqVTO2bCjVhB4J7XbzcKiSuuJ8R2aG8EC3gIrZU/s1600/3FN_1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;220&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkbkDZ3aQehef7suwRoWc0RzdGxdQJvq6drteih3Ig-6Oylo-R4LceKmvNOOSgb4hg2XXi88AGRwl10AOWuddcwRDPJi8qjF5EG6eDGXqVTO2bCjVhB4J7XbzcKiSuuJ8R2aG8EC3gIrZU/s640/3FN_1.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
No exemplo acima as colunas Endereço, No., Bairro, Cep e Cidade dependem da coluna CGC que não é chave primária da tabela Pedido (dependência transitiva). Após, isto, conseguimos definir um novo esquema com duas tabelas respeitando a 3FN, Pedido e Cliente.&lt;br /&gt;
&lt;br /&gt;
Pessoal, este é o último post sobre Normalização de Dados. Tentei 
tratar o assunto de forma resumida, falando somente sobre as 3 primeiras
 formas normais.</content><link rel='replies' type='application/atom+xml' href='http://sqlaprendendo.blogspot.com/feeds/7790123942309496940/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/05/normalizacao-de-dados-parte-3.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/7790123942309496940'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/7790123942309496940'/><link rel='alternate' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/05/normalizacao-de-dados-parte-3.html' title='Normalização de Dados - Parte 3'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkbkDZ3aQehef7suwRoWc0RzdGxdQJvq6drteih3Ig-6Oylo-R4LceKmvNOOSgb4hg2XXi88AGRwl10AOWuddcwRDPJi8qjF5EG6eDGXqVTO2bCjVhB4J7XbzcKiSuuJ8R2aG8EC3gIrZU/s72-c/3FN_1.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4036429675738629295.post-7238950157821772762</id><published>2012-05-03T21:48:00.001-03:00</published><updated>2012-05-06T20:48:26.582-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="1FN"/><category scheme="http://www.blogger.com/atom/ns#" term="2FN"/><category scheme="http://www.blogger.com/atom/ns#" term="Modelo Relacional"/><category scheme="http://www.blogger.com/atom/ns#" term="Normalização"/><title type='text'>Normalização de Dados - Parte 2</title><content type='html'>Aqui vai o segundo post sobre Normalização de Dados. Vamos falar sobre a Segunda Forma Normal (2FN).&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;Uma tabela está na Segunda Forma Normal (2FN) se estiver na 1FN e cada uma das colunas não pertencentes à chave primária não for dependente parcialmente dessa chave.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Processo para obtenção da Segunda Forma Normal (2FN)&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
1- Identificar as colunas que não participam da chave primária da tabela;&lt;br /&gt;
2- Para cada um das colunas identificadas, analisar se seu valor é determinado por parte, ou pela totalidade da chave;&lt;br /&gt;
3- Para as colunas dependentes parcialmente da chave;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - Criar novas tabelas onde a chave primária será(ão) a(s) coluna(s) da chave primária original que&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; determinou(aram) o valor da coluna analisada;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - Excluir da tabela original as colunas dependentes parcialmente da chave;&lt;br /&gt;
&lt;br /&gt;
Tudo isso parece muito complicado não? Acredito que uma imagem vai demonstrar melhor:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjL0XWLerW1dqCdwsYTeaIsDrWxLNkHdvUo5SKxLFgKn7Z9O3cPXfsJ8pIS-1M9-tQwDs0a-UIv4bFQrAe8zAc6qZdmCO2ulv6tpN3mN5JUNIAV5BXZPYIdzNosN7f2eq3BCqsY2okysTat/s1600/2FN_1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;312&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjL0XWLerW1dqCdwsYTeaIsDrWxLNkHdvUo5SKxLFgKn7Z9O3cPXfsJ8pIS-1M9-tQwDs0a-UIv4bFQrAe8zAc6qZdmCO2ulv6tpN3mN5JUNIAV5BXZPYIdzNosN7f2eq3BCqsY2okysTat/s640/2FN_1.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlaprendendo.blogspot.com/feeds/7238950157821772762/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/05/normalizacao-de-dados-parte-2.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/7238950157821772762'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/7238950157821772762'/><link rel='alternate' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/05/normalizacao-de-dados-parte-2.html' title='Normalização de Dados - Parte 2'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjL0XWLerW1dqCdwsYTeaIsDrWxLNkHdvUo5SKxLFgKn7Z9O3cPXfsJ8pIS-1M9-tQwDs0a-UIv4bFQrAe8zAc6qZdmCO2ulv6tpN3mN5JUNIAV5BXZPYIdzNosN7f2eq3BCqsY2okysTat/s72-c/2FN_1.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4036429675738629295.post-7121160286760408465</id><published>2012-05-01T15:23:00.000-03:00</published><updated>2012-05-01T19:48:29.290-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="1FN"/><category scheme="http://www.blogger.com/atom/ns#" term="Modelo Relacional"/><category scheme="http://www.blogger.com/atom/ns#" term="Normalização"/><title type='text'>Normalização de Dados - Parte 1</title><content type='html'>Estava organizando o HD do meu note quando encontrei uma apresentação sobre &lt;a href=&quot;http://pt.wikipedia.org/wiki/Normaliza%C3%A7%C3%A3o_de_dados&quot;&gt;Normalização de dados e formas normais&lt;/a&gt;.&lt;br /&gt;
Decidi falar um pouco sobre o assunto pois acho que tem tudo a ver com quer trabalhar com bancos de dados.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Mas o que é&amp;nbsp;
&lt;a href=&quot;http://pt.wikipedia.org/wiki/Normaliza%C3%A7%C3%A3o_de_dados&quot;&gt;Normalização de dados&lt;/a&gt;?&lt;br /&gt;
&lt;br /&gt;
Consiste em definir o formato lógico adequado para as estruturas de dados identificadas no &lt;a href=&quot;http://pt.wikipedia.org/wiki/Modelagem_de_dados&quot;&gt;Modelo de Dados&lt;/a&gt;, com o objetivo de minimizar o espaço utilizado pelos dados e garantir a integridade e confiabilidade das informações.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A Normalização é feita, através da análise dos dados que compõem as estruturas, utilizando o conceito &amp;nbsp;chamado “Formas Normais (FN)”.&lt;br /&gt;
&lt;br /&gt;
As Formas Normais são um conjunto de restrições formado por normas a serem vistas a seguir. Falarei somente sobre as três primeiras que para mim são as mais importantes.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;b&gt;Primeira Forma Normal – 1FN&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Para cada tabela, eliminar os grupos repetitivos gerando uma nova tabela, na qual cada um dos itens repetitivos dará origem a uma nova linha e na qual a chave primária será a concatenação da chave da tabela original com uma nova coluna que identifique de modo unívoco a linha.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Processo para obtenção da Primeira Forma Normal (1FN)&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Exemplo de processo para obtenção da 1FN:&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Tabela &amp;nbsp;Pedido Não Normalizada&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXb7NWbyys_TaNs3LgCpATAIwWyvTDppw9JH7-aJzFTa7edf2Oq57MnCaz-mDqW5U37aVs-2M-CX82cc72WupXl53BksIcWgzUroQh39sIicfNYUcPKLmDEs06NOoxNQFYbku1gWcpo3Zr/s1600/TabelaPedidoNaoNormalizada.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;228&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXb7NWbyys_TaNs3LgCpATAIwWyvTDppw9JH7-aJzFTa7edf2Oq57MnCaz-mDqW5U37aVs-2M-CX82cc72WupXl53BksIcWgzUroQh39sIicfNYUcPKLmDEs06NOoxNQFYbku1gWcpo3Zr/s640/TabelaPedidoNaoNormalizada.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;b&gt;1- Definir as chaves alternativas e escolher a chave primária da tabela&lt;/b&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVpTvL1l_QPQMX1PJtibqPm6sUYnuBxU5hVTVOIH8XI6FbWBuiJ9Q_ENO5Mz8CCkaXQhliDKF2c916LD4gnM2bf4ufOZnBouP3MOwAGTwKRgHI-7LHLMWaRVjyJaVMbrUBC2y32OB1kMrZ/s1600/1FN_1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;228&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVpTvL1l_QPQMX1PJtibqPm6sUYnuBxU5hVTVOIH8XI6FbWBuiJ9Q_ENO5Mz8CCkaXQhliDKF2c916LD4gnM2bf4ufOZnBouP3MOwAGTwKRgHI-7LHLMWaRVjyJaVMbrUBC2y32OB1kMrZ/s640/1FN_1.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;- &amp;nbsp;Para definir a chave primária na Tabela &amp;nbsp;Pedido, temos que identificar os atributos (colunas) que possam identificar de maneira única as linhas;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;- Esses atributos seriam as chaves alternativas;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;- Como a único atributo que caracteriza uma chave alternativa na Relação Pedido é o &lt;span style=&quot;color: red;&quot;&gt;Número Pedido&lt;/span&gt;, ele automaticamente é a chave primária;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;- Acima sublinhamos o atributo Número Pedido para identificar que ele é uma chave primária;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;2- Transformar Atributos compostos em atômicos&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCpxhokLrwsdQO2rLmVuQY-A6Oi6jgSGdQTZGBUJI5Q2ZzX4KTbGILFfPhEyslYuCCag62EcpH9SakYra3SA9ErsozGgM3M9yiCbIqPCduQ7X4VDFAtTYAHy44ZXhkTJCJVM9umtq1iSXO/s1600/1FN_2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;290&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCpxhokLrwsdQO2rLmVuQY-A6Oi6jgSGdQTZGBUJI5Q2ZzX4KTbGILFfPhEyslYuCCag62EcpH9SakYra3SA9ErsozGgM3M9yiCbIqPCduQ7X4VDFAtTYAHy44ZXhkTJCJVM9umtq1iSXO/s640/1FN_2.jpg&quot; style=&quot;cursor: move;&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;3 - Criar uma nova entidade com a chave primária da tabela anterior e o grupo que possui várias ocorrências (estrutura de vetor), a chave primária da nova tabela será obtida pela concatenação da &amp;nbsp;chave primária da tabela inicial e a do grupo repetitivo&lt;/b&gt;
&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3uw46X82zFSYnnTLnXUyUuNkm-RtAJMc-dU0dMqbSEiEIYQDDpPZw7NKFXs_Iw_hhdch31rBH9KeS4v-BqRB7isXUV3_E6GoCUyZXRYh1YFY9hmXa-b6-yQEZhjujsmJgyKuKUBZa83vo/s1600/1FN_3.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;330&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3uw46X82zFSYnnTLnXUyUuNkm-RtAJMc-dU0dMqbSEiEIYQDDpPZw7NKFXs_Iw_hhdch31rBH9KeS4v-BqRB7isXUV3_E6GoCUyZXRYh1YFY9hmXa-b6-yQEZhjujsmJgyKuKUBZa83vo/s640/1FN_3.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlaprendendo.blogspot.com/feeds/7121160286760408465/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/05/normalizacao-de-dados-parte-1.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/7121160286760408465'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/7121160286760408465'/><link rel='alternate' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/05/normalizacao-de-dados-parte-1.html' title='Normalização de Dados - Parte 1'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXb7NWbyys_TaNs3LgCpATAIwWyvTDppw9JH7-aJzFTa7edf2Oq57MnCaz-mDqW5U37aVs-2M-CX82cc72WupXl53BksIcWgzUroQh39sIicfNYUcPKLmDEs06NOoxNQFYbku1gWcpo3Zr/s72-c/TabelaPedidoNaoNormalizada.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4036429675738629295.post-3371620987536565186</id><published>2012-05-01T11:45:00.001-03:00</published><updated>2012-06-01T22:57:43.482-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="from"/><category scheme="http://www.blogger.com/atom/ns#" term="MySQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle"/><category scheme="http://www.blogger.com/atom/ns#" term="Select"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><category scheme="http://www.blogger.com/atom/ns#" term="where"/><title type='text'>Select Básico - Parte 1</title><content type='html'>O comando Select na linguagem SQL é utilizado para fazer consultas aos dados de uma ou mais tabelas ou views. A sintaxe do comando Select pode ser bem complexa, mas vamos começar do básico.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;Sintaxe:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
SELECT&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;lista de seleção&amp;gt;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; [ FROM { &amp;lt;tabela&amp;gt; | &amp;lt;view&amp;gt; } [ ,...n ] ]&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; [ WHERE &amp;lt;condição de pesquisa&amp;gt; ]&lt;br /&gt;
&lt;br /&gt;
Onde:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&amp;lt;lista de seleção&amp;gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Define as colunas a serem listada para o resultado. A lista deve ser separada por vírgulas e pode conter funções e colunas calculadas.&lt;br /&gt;
&lt;br /&gt;
* - Define que todas as colunas das tabelas ou views serão exibidas.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&amp;lt;tabela&amp;gt; | &amp;lt;view&amp;gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Tabela(s) ou view(s) utilizada(s) na consulta.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&amp;lt;condição de pesquisa&amp;gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Define a condição de pesquisa da consulta.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Exemplos:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Nestes exemplos utilizamos a tabela Funcionario criada no post &lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/tabelas-para-nossos-exemplos.html&quot;&gt;Tabelas para nossos exemplos&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Selecionando todos os campos e linhas de uma tabela:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Select * From Funcionario&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Utilizando uma condição simples:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Select IdFuncionario,Nome From Funcionario Where IdFuncionario=1&lt;br /&gt;
&lt;br /&gt;
Sintaxe específica: &lt;a href=&quot;http://msdn.microsoft.com/pt-br/library/ms189499.aspx&quot;&gt;Miscrosoft SQL Server&lt;/a&gt;, &lt;a href=&quot;http://dev.mysql.com/doc/refman/4.1/pt/select.html&quot;&gt;MySQL&lt;/a&gt;, &lt;a href=&quot;http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_10002.htm&quot;&gt;Oracle&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Veja também&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-2.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 2&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-3.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 3&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-4.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 4&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-5.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 5&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqlaprendendo.blogspot.com.br/2012/05/select-basico-parte-6.html&quot; target=&quot;_blank&quot;&gt;Select Básico - Parte 6&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlaprendendo.blogspot.com/feeds/3371620987536565186/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/05/select-basico-parte-1.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/3371620987536565186'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/3371620987536565186'/><link rel='alternate' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/05/select-basico-parte-1.html' title='Select Básico - Parte 1'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4036429675738629295.post-3385826139150573892</id><published>2012-05-01T11:23:00.005-03:00</published><updated>2012-05-01T11:23:31.779-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Create table"/><category scheme="http://www.blogger.com/atom/ns#" term="Insert"/><category scheme="http://www.blogger.com/atom/ns#" term="MySQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><title type='text'>Tabelas para nossos exemplos</title><content type='html'>Neste post vamos criar e inserir dados em duas tabelas para utilizarmos em nossos exemplos. Não se preocupem com os comandos agora, explicarei tudo mais tarde. Estes comandos foram testados no MySQL e no SQL Server.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;&lt;b&gt;Estrutura tabela Funcionário&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 521px;&quot;&gt;&lt;colgroup&gt;&lt;col style=&quot;mso-width-alt: 6765; mso-width-source: userset; width: 139pt;&quot; width=&quot;185&quot;&gt;&lt;/col&gt;
 &lt;col span=&quot;2&quot; style=&quot;mso-width-alt: 2852; mso-width-source: userset; width: 59pt;&quot; width=&quot;78&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 6582; mso-width-source: userset; width: 135pt;&quot; width=&quot;180&quot;&gt;&lt;/col&gt;
 &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr height=&quot;21&quot; style=&quot;height: 15.75pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;21&quot; style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: .5pt solid white; color: black; font-family: Calibri; font-size: 12.0pt; font-weight: 700; height: 15.75pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 139pt;&quot; width=&quot;185&quot;&gt;Coluna&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: .5pt solid white; color: black; font-family: Calibri; font-size: 12.0pt; font-weight: 700; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 59pt;&quot; width=&quot;78&quot;&gt;Tipo&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: .5pt solid white; color: black; font-family: Calibri; font-size: 12.0pt; font-weight: 700; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 59pt;&quot; width=&quot;78&quot;&gt;Tamanho&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: none; border-top: .5pt solid white; color: black; font-family: Calibri; font-size: 12.0pt; font-weight: 700; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 135pt;&quot; width=&quot;180&quot;&gt;Descrição&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td height=&quot;20&quot; style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;IdFuncionario&lt;/td&gt;
  &lt;td style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;int&lt;/td&gt;
  &lt;td style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: none; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;Código do Funcionário&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td height=&quot;20&quot; style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;Nome&lt;/td&gt;
  &lt;td style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;varchar&lt;/td&gt;
  &lt;td align=&quot;right&quot; style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;60&lt;/td&gt;
  &lt;td style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: none; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;Nome do Funcionário&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td height=&quot;20&quot; style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;DDD&lt;/td&gt;
  &lt;td style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;char&lt;/td&gt;
  &lt;td align=&quot;right&quot; style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;2&lt;/td&gt;
  &lt;td style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: none; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;DDD do Telefone&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td height=&quot;20&quot; style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;Fone&lt;/td&gt;
  &lt;td style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;varchar&lt;/td&gt;
  &lt;td align=&quot;right&quot; style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;20&lt;/td&gt;
  &lt;td style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: none; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;Número do Telefone&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td height=&quot;20&quot; style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;Email&lt;/td&gt;
  &lt;td style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;varchar&lt;/td&gt;
  &lt;td align=&quot;right&quot; style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;50&lt;/td&gt;
  &lt;td style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: none; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;Email&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td height=&quot;20&quot; style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;idDepto&lt;/td&gt;
  &lt;td style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;int&lt;/td&gt;
  &lt;td style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: none; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;Código do Departamento&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td height=&quot;20&quot; style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;Logradouro&lt;/td&gt;
  &lt;td style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;varchar&lt;/td&gt;
  &lt;td align=&quot;right&quot; style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;100&lt;/td&gt;
  &lt;td style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: none; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;Logradouro&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td height=&quot;20&quot; style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;NrLogradouro&lt;/td&gt;
  &lt;td style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;char&lt;/td&gt;
  &lt;td align=&quot;right&quot; style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;10&lt;/td&gt;
  &lt;td style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: none; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;Número do Logradouro&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td height=&quot;20&quot; style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;ComplementoEndereco&lt;/td&gt;
  &lt;td style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;varchar&lt;/td&gt;
  &lt;td align=&quot;right&quot; style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;40&lt;/td&gt;
  &lt;td style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: none; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;Complemento do Endereço&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td height=&quot;20&quot; style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;Bairro&lt;/td&gt;
  &lt;td style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;varchar&lt;/td&gt;
  &lt;td align=&quot;right&quot; style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;60&lt;/td&gt;
  &lt;td style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: none; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;Bairro&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td height=&quot;20&quot; style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;Cidade&lt;/td&gt;
  &lt;td style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;varchar&lt;/td&gt;
  &lt;td align=&quot;right&quot; style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;60&lt;/td&gt;
  &lt;td style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: none; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;Cidade&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td height=&quot;20&quot; style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;UF&lt;/td&gt;
  &lt;td style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;char&lt;/td&gt;
  &lt;td align=&quot;right&quot; style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;2&lt;/td&gt;
  &lt;td style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: none; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;Unidade Federativa&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td height=&quot;20&quot; style=&quot;background: #B8CCE4; border-bottom: none; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;CEP&lt;/td&gt;
  &lt;td style=&quot;background: #B8CCE4; border-bottom: none; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;char&lt;/td&gt;
  &lt;td align=&quot;right&quot; style=&quot;background: #B8CCE4; border-bottom: none; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;8&lt;/td&gt;
  &lt;td style=&quot;background: #B8CCE4; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;CEP&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;b&gt;Criando tabela Funcionario:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Create table Funcionario&lt;br /&gt;
(IdFuncionario int, Nome varchar(60), DDD char(2), Fone varchar(20), Email varchar(50), IdDepto int,&lt;br /&gt;
Logradouro varchar(100),NrLogradouro char(10),ComplementoEndereco varchar(40),Bairro varchar(60),Cidade varchar(60),UF char(2),CEP char(8));&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Inserindo dados na tabela Funcionario&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
Insert Into Funcionario &lt;br /&gt;
(IdFuncionario,Nome,DDD,Fone,Email,IdDepto,Logradouro,NrLogradouro,ComplementoEndereco,Bairro,Cidade,UF,CEP)&lt;br /&gt;
Values&lt;br /&gt;
&amp;nbsp;(1,&#39;Joaquim José&#39;,&#39;11&#39;,&#39;11111111&#39;,&#39;joaquim.jose@xpto.com&#39;,1,&#39;R das Flores&#39;,&#39;55&#39;,&#39;&#39;,&#39;Sao Geraldo&#39;,&#39;Sao Paulo&#39;,&#39;SP&#39;,&#39;12345678&#39;),&lt;br /&gt;
&amp;nbsp;(2,&#39;Pedro Silva&#39;,&#39;12&#39;,&#39;22222222&#39;,&#39;pedro@xpto.com&#39;,2,&#39;Av São Paulo&#39;,&#39;20&#39;,&#39;&#39;,&#39;Sao Geraldo&#39;,&#39;Sao Paulo&#39;,&#39;SP&#39;,&#39;11111111&#39;),&lt;br /&gt;
&amp;nbsp;(3,&#39;Mário Mattos&#39;,&#39;13&#39;,&#39;33333333&#39;,&#39;mario@xpto.com&#39;,3,&#39;R XXXX&#39;,&#39;23&#39;,&#39;&#39;,&#39;Sao Geraldo&#39;,&#39;Sao Paulo&#39;,&#39;SP&#39;,&#39;22222222&#39;),&lt;br /&gt;
&amp;nbsp;(4,&#39;Manuel Antônio&#39;,&#39;41&#39;,&#39;44444444&#39;,&#39;manuel@xpto.com&#39;,4,&#39;R YYYYY&#39;,&#39;77&#39;,&#39;&#39;,&#39;Sao Geraldo&#39;,&#39;Sao Paulo&#39;,&#39;SP&#39;,&#39;33333333&#39;),&lt;br /&gt;
&amp;nbsp;(5,&#39;Maria Aparecida&#39;,&#39;21&#39;,&#39;55555555&#39;,&#39;ma@xpto.com&#39;,5,&#39;R ABC&#39;,&#39;99&#39;,&#39;&#39;,&#39;Sao Geraldo&#39;,&#39;Sao Paulo&#39;,&#39;SP&#39;,&#39;66666666&#39;),&lt;br /&gt;
&amp;nbsp;(6,&#39;Daniel Borges&#39;,&#39;31&#39;,&#39;66666666&#39;,&#39;danielb@xpto.com&#39;,6,&#39;R 123&#39;,&#39;100&#39;,&#39;&#39;,&#39;Sao Geraldo&#39;,&#39;Sao Paulo&#39;,&#39;SP&#39;,&#39;77777777&#39;),&lt;br /&gt;
&amp;nbsp;(7,&#39;Diana Cristina&#39;,&#39;22&#39;,&#39;77777777&#39;,&#39;diana@xpto.com&#39;,7,&#39;R Piracicaba&#39;,&#39;213&#39;,&#39;&#39;,&#39;Sao Geraldo&#39;,&#39;Sao Paulo&#39;,&#39;SP&#39;,&#39;99999999&#39;),&lt;br /&gt;
&amp;nbsp;(8,&#39;Miriam Lagos&#39;,&#39;43&#39;,&#39;88888888&#39;,&#39;miriam@xpto.com&#39;,8,&#39;R Dona Zica&#39;,&#39;445&#39;,&#39;&#39;,&#39;Sao Geraldo&#39;,&#39;Sao Paulo&#39;,&#39;SP&#39;,&#39;44444444&#39;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Estrutura tabela Departamento&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 521px;&quot;&gt;&lt;tbody&gt;
&lt;tr height=&quot;21&quot; style=&quot;height: 15.75pt;&quot;&gt;&lt;td class=&quot;xl63&quot; height=&quot;21&quot; style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: .5pt solid white; color: black; font-family: Calibri; font-size: 12.0pt; font-weight: 700; height: 15.75pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 139pt;&quot; width=&quot;185&quot;&gt;Coluna&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: .5pt solid white; color: black; font-family: Calibri; font-size: 12.0pt; font-weight: 700; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 59pt;&quot; width=&quot;78&quot;&gt;Tipo&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: .5pt solid white; color: black; font-family: Calibri; font-size: 12.0pt; font-weight: 700; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 59pt;&quot; width=&quot;78&quot;&gt;Tamanho&lt;/td&gt;
  &lt;td class=&quot;xl63&quot; style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: none; border-top: .5pt solid white; color: black; font-family: Calibri; font-size: 12.0pt; font-weight: 700; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 135pt;&quot; width=&quot;180&quot;&gt;Descrição&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td height=&quot;20&quot; style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;IdDepto&lt;/td&gt;
  &lt;td style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;int&lt;/td&gt;
  &lt;td style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td style=&quot;background: #B8CCE4; border-bottom: .5pt solid white; border-left: none; border-right: none; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #B8CCE4 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;Código do Departamento&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td height=&quot;20&quot; style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; height: 15.0pt; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;NomeDepto&lt;/td&gt;
  &lt;td style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;varchar&lt;/td&gt;
  &lt;td align=&quot;right&quot; style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: .5pt solid white; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;50&lt;/td&gt;
  &lt;td style=&quot;background: #DBE5F1; border-bottom: .5pt solid white; border-left: none; border-right: none; border-top: none; color: black; font-family: Calibri; font-size: 11.0pt; font-weight: 400; mso-pattern: #DBE5F1 none; text-decoration: none; text-line-through: none; text-underline-style: none;&quot;&gt;Nome do Departamento&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;b&gt;Criando tabela Departamento:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Create Table Departamento&lt;br /&gt;
(IdDepto int, NomeDepto varchar(50));&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Inserindo dados na tabela Departamento:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Insert Into Departamento (IdDepto,NomeDepto)&lt;br /&gt;
Values&lt;br /&gt;
&amp;nbsp;(1,&#39;Administração&#39;),&lt;br /&gt;
&amp;nbsp;(2,&#39;Contabilidade&#39;),&lt;br /&gt;
&amp;nbsp;(3,&#39;TI&#39;),&lt;br /&gt;
&amp;nbsp;(4,&#39;Almoxarifado&#39;),&lt;br /&gt;
&amp;nbsp;(5,&#39;Segurança&#39;),&lt;br /&gt;
&amp;nbsp;(6,&#39;Controladoria&#39;),&lt;br /&gt;
&amp;nbsp;(7,&#39;Compras&#39;),&lt;br /&gt;
&amp;nbsp;(8,&#39;Contas a Pagar&#39;); &lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlaprendendo.blogspot.com/feeds/3385826139150573892/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/05/tabelas-para-nossos-exemplos.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/3385826139150573892'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/3385826139150573892'/><link rel='alternate' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/05/tabelas-para-nossos-exemplos.html' title='Tabelas para nossos exemplos'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4036429675738629295.post-2126437215016135800</id><published>2012-05-01T10:29:00.001-03:00</published><updated>2012-05-01T10:42:49.685-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="download"/><category scheme="http://www.blogger.com/atom/ns#" term="Instalando"/><category scheme="http://www.blogger.com/atom/ns#" term="MySQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><title type='text'>Instalando um SGDB</title><content type='html'>Pessoal, para executarmos nossos exemplos seria interessante instalarmos um gerenciador de banco de dados.&lt;br /&gt;
Escolhi dois gerenciadores mas vocês podem escolher qualquer outro.&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Antes baixem os arquivos necessários:&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://dev.mysql.com/downloads/installer/&quot;&gt;download MySQL&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.microsoft.com/sqlserver/2008/pt/br/express.aspx&quot;&gt;download Microsoft SQL Server&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Agora vejam os videos para instalação:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://youtube.googleapis.com/v/Cehmc4EfvlI&amp;amp;fs=1&amp;amp;source=uds&amp;amp;autoplay=1&quot;&gt;Instalando MySQL&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.youtube.com/watch?v=gxO0T02txL4&amp;amp;feature=related&quot;&gt;Instalando Microsoft SQL Server&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlaprendendo.blogspot.com/feeds/2126437215016135800/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/05/instalando-um-sgdb.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/2126437215016135800'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/2126437215016135800'/><link rel='alternate' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/05/instalando-um-sgdb.html' title='Instalando um SGDB'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4036429675738629295.post-4788142476061758186</id><published>2012-04-30T00:47:00.002-03:00</published><updated>2012-04-30T02:17:07.152-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="DB2"/><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><title type='text'>Alguns Sites interessantes</title><content type='html'>&lt;br /&gt;
&lt;h2&gt;




Alguns bons sites:&lt;/h2&gt;
&lt;div&gt;
&lt;a href=&quot;http://www.mcdbabrasil.com.br/index.php&quot;&gt;MCDBA Brasil&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://www.mcdbabrasil.com.br/themes/phpib2/images/logo.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;53&quot; src=&quot;http://www.mcdbabrasil.com.br/themes/phpib2/images/logo.jpg&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: #444444;&quot;&gt;
&lt;a href=&quot;http://www.sqlservercentral.com/&quot;&gt;SQL ServerCentral.com&lt;/a&gt;&lt;/div&gt;
&lt;a href=&quot;http://www.sqlservercentral.com/Resources/Images/sqlservercentral_logo.gif&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; display: inline !important; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;59&quot; src=&quot;http://www.sqlservercentral.com/Resources/Images/sqlservercentral_logo.gif&quot; title=&quot;&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://searchsqlserver.techtarget.com/&quot;&gt;SearchSQLServer&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.sql-server-performance.com/&quot;&gt;SQLServerPerformace.com&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://c3154802.r2.cf0.rackcdn.com/ssplogo.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;37&quot; src=&quot;http://c3154802.r2.cf0.rackcdn.com/ssplogo.jpg&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://searchoracle.techtarget.com/&quot;&gt;SearchOracle&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.devmedia.com.br/revista-sql-magazine&quot;&gt;Revista SQL Magazine&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlaprendendo.blogspot.com/feeds/4788142476061758186/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/04/alguns-sites-interessantes.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/4788142476061758186'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4036429675738629295/posts/default/4788142476061758186'/><link rel='alternate' type='text/html' href='http://sqlaprendendo.blogspot.com/2012/04/alguns-sites-interessantes.html' title='Alguns Sites interessantes'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>