<?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-7010404629734647455</id><updated>2026-11-07T09:48:06.525-03:00</updated><category term="postgresql"/><category term="funções de manipulação de string"/><category term="data"/><category term="date"/><category term="funções de agrupamento"/><category term="mysql"/><category term="comando psql"/><category term="Windows"/><category term="Google Cloud VM"/><category term="sql"/><category term="REGEXP_REPLACE"/><category term="coluna"/><category term="criar um banco de dados no postgresql"/><category term="formatar string postgresql"/><category term="formatação postgresql"/><category term="rollup"/><category term="PgAdmin III"/><category term="condicional"/><category term="copy"/><category term="create table"/><category term="ordenar valores por posição"/><category term="posição dos valores sql"/><category term="rankear valores"/><category term="ranquear valores"/><category term="window functions"/><category term="Find all tables containing column with specified name"/><category term="Google Cloud VM - Password root"/><category term="Google Cloud VM - Senha de root do Debian"/><category term="PowerShell"/><category term="Python"/><category term="What is the equivalent of &#39;CREATE TABLE SELECT&#39; in SQL SERVER"/><category term="comando select into no sql server"/><category term="completar com caracteres a esquerda"/><category term="completar com zeros a esquerda"/><category term="concat"/><category term="copiar dados de uma tabela para uma nova tabela no sql server"/><category term="copiar informações de uma tabela para uma outra tabela"/><category term="dense_rank"/><category term="dense_rank in mysql"/><category term="dense_rank no mysql"/><category term="equivalente a rownum no mysql"/><category term="function concat sql server"/><category term="function postgresql string"/><category term="função sql server"/><category term="função substituir palavra"/><category term="juntar string sql server"/><category term="lpad"/><category term="operator concat sql server"/><category term="oracle"/><category term="rownum in mysql"/><category term="rpad"/><category term="substituir caractere"/><category term="substituir caracteres"/><category term="substituir palavra"/><category term="tnc"/><category term="unir string sql server"/><category term="valor maximo de uma coluna"/><category term="verificar porta aberta no Windows"/><title type='text'>Dicas Sql</title><subtitle type='html'>Dicas sobre sql.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://jquerydicas.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://jquerydicas.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Kelly</name><uri>http://www.blogger.com/profile/03449060135636479990</uri><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>71</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7010404629734647455.post-5290194207779477921</id><published>2025-12-10T16:44:00.008-03:00</published><updated>2025-12-10T19:08:02.464-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><title type='text'>Instalação do Python Install Manager no Windows 11</title><content type='html'>&lt;p&gt;Neste post,&amp;nbsp; será descrito o passo a passo de como instalar o Python utilizando o &quot;Python Install Manager&quot; (Gerenciador de instalação do Python).&lt;/p&gt;&lt;p&gt;&lt;b&gt;1º passo)&lt;/b&gt; Verifique se já não existe alguma instalação do Python antes de instalar o Python Install Manager. Para fazer esta verificação, digite o comando abaixo no Prompt de Comando do Windows ou no Windows PowerShell:&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;color: #073763;&quot;&gt;python --version&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;b&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjxRCEO8E5KKOKNHLwRAO6V9v7FpHYbb3RtpMwHyPeHqAyQcSxhfS11p2RWV6JaCzdO6vTykN-n8pIa3iNRQ48Cd9Slwn-YU8eqaDnMP0DFdhdiGcuxtdblJV2ahVJHIS6NeEh4Mcrhto8eYaxvZoBpntoFq-tKmaHDsKmMeP4tnxPQurWja7yfi6vzG0U&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;314&quot; data-original-width=&quot;459&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjxRCEO8E5KKOKNHLwRAO6V9v7FpHYbb3RtpMwHyPeHqAyQcSxhfS11p2RWV6JaCzdO6vTykN-n8pIa3iNRQ48Cd9Slwn-YU8eqaDnMP0DFdhdiGcuxtdblJV2ahVJHIS6NeEh4Mcrhto8eYaxvZoBpntoFq-tKmaHDsKmMeP4tnxPQurWja7yfi6vzG0U=s16000&quot; /&gt;&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;2º passo)&lt;/b&gt; Caso NÃO exista uma instalação pule para o próximo passo, caso exista desinstale-a.&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;b&gt;3º passo)&lt;/b&gt; Acesse o site oficial: &lt;a href=&quot;http://python.org&quot; target=&quot;_blank&quot;&gt;python.org&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;&lt;b&gt;4º passo)&lt;/b&gt; No menu, na parte superior da tela, clique em &quot;Downloads&quot;, em seguida escolha o sistema operacional &quot;Windows&quot;. Veja a imagem abaixo, com os itens destacados em vermelho.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiv1asKD6CDORZB7JCCMkvP3_5Ytyd1wJMMx0Y_L_tArPnxsJs__w9BaEs_9z5LEltBi03rG6zS6PiDZ22qxUrgO9f4vjFxsBtNltvl4Tid8XvLWv2RYBgMU3xNFU6w4NDM9jKwGkbLld8FEbI8Dz_KFAfKv-epwmsNyrgPsfQLPDIyXiuEhWZlMIpMgIM&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;623&quot; data-original-width=&quot;885&quot; height=&quot;374&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiv1asKD6CDORZB7JCCMkvP3_5Ytyd1wJMMx0Y_L_tArPnxsJs__w9BaEs_9z5LEltBi03rG6zS6PiDZ22qxUrgO9f4vjFxsBtNltvl4Tid8XvLWv2RYBgMU3xNFU6w4NDM9jKwGkbLld8FEbI8Dz_KFAfKv-epwmsNyrgPsfQLPDIyXiuEhWZlMIpMgIM=w531-h374&quot; width=&quot;531&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p style=&quot;clear: both; text-align: left;&quot;&gt;&lt;b&gt;5º passo)&lt;/b&gt; Clique no link &quot;Latest Python install manager - Python install manager 25.2&quot; . Veja a imagem abaixo:&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhY5iFzMe5NaasWYjgqQs0RiE-IUZrsShZuo_dm5E7ols7Sd0ESUjLixfgpNqNWeJRiAerxeaPz2C2ncmFq79XIFqgwkg_G-FDUPmr0V5jZy2iYmQK1p2Nq_ebttAwj0edg2qUmkMjeK6p1Uc6RW8EVAfUrMzC8j1Ycd4kK5ewD79166RfzAA824kUErpc&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;478&quot; data-original-width=&quot;536&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhY5iFzMe5NaasWYjgqQs0RiE-IUZrsShZuo_dm5E7ols7Sd0ESUjLixfgpNqNWeJRiAerxeaPz2C2ncmFq79XIFqgwkg_G-FDUPmr0V5jZy2iYmQK1p2Nq_ebttAwj0edg2qUmkMjeK6p1Uc6RW8EVAfUrMzC8j1Ycd4kK5ewD79166RfzAA824kUErpc=s16000&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;b&gt;6º passo)&lt;/b&gt; Será aberta uma nova tela, clique no botão na parte inferior da tela &quot;Download Installer (MSIX)&quot; para fazer o download do gerenciador. No momento desta publicação, a versão do gerenciador era: python-manager-25.2.msix. Veja a imagem abaixo:&lt;/p&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiz82M7YmEZVUvSn2uEDVvK5NDHjag1cPHRGyVletRvPG1_Nd8X0VDDW1KmW9hGkLXeqTHcxy3PwkCw0HSujYUBpwLfd6E8WjUeuYan7GUP21E8OjAn_oc11kLRBI4uhcK0YbCQl_1M0PwJxjxnuDCEw5WfbYeIf8Z3BzNXX_2CervMeYBThoOKcjEe1wU&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;742&quot; data-original-width=&quot;1050&quot; height=&quot;383&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiz82M7YmEZVUvSn2uEDVvK5NDHjag1cPHRGyVletRvPG1_Nd8X0VDDW1KmW9hGkLXeqTHcxy3PwkCw0HSujYUBpwLfd6E8WjUeuYan7GUP21E8OjAn_oc11kLRBI4uhcK0YbCQl_1M0PwJxjxnuDCEw5WfbYeIf8Z3BzNXX_2CervMeYBThoOKcjEe1wU=w542-h383&quot; width=&quot;542&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;7º passo)&lt;/b&gt;&amp;nbsp; Após o download, clique no arquivo python-manager-25.2.msix&lt;/p&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhE_vaNLLvQnN7TXjR6b_f21guoSi_W98HI6N3gxZwTxyDDii-6n6jdWTW0r6V4K-GwXB_RORBsC2ebVCbAJKIY47wp-nxs8vJO6f3iQJeptqiINPp7QiylkhUXEgvs9X5bGa_-3Msw4Ae-fzRosRAERmlOfD6UNmuY7WdZ9JLQNJ-ESIFefYaS8enSvBU&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;323&quot; data-original-width=&quot;671&quot; height=&quot;246&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhE_vaNLLvQnN7TXjR6b_f21guoSi_W98HI6N3gxZwTxyDDii-6n6jdWTW0r6V4K-GwXB_RORBsC2ebVCbAJKIY47wp-nxs8vJO6f3iQJeptqiINPp7QiylkhUXEgvs9X5bGa_-3Msw4Ae-fzRosRAERmlOfD6UNmuY7WdZ9JLQNJ-ESIFefYaS8enSvBU=w511-h246&quot; width=&quot;511&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;b&gt;8º passo)&amp;nbsp;&lt;/b&gt;Clique no botão em &quot;Instalar Python&quot;. Veja a imagem abaixo:&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEh4rQz3Z62r9SSBXeDASyoD6HHo846EtXGnKr0c_QJSDXrDO-DiAQIoQ8krbYwfttaWOjkyXCHO0tLGgSJAuuFlbxYVZMyvtAM8FHL8758rxWzn2GKG24YdSy6KcmChMznbLPc1MnkiPgKvicPQqZskvgVCAfEIsA_y-g6DqbxyXttXBuMkgE8csk1LZyk&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;&quot; data-original-height=&quot;527&quot; data-original-width=&quot;646&quot; height=&quot;449&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEh4rQz3Z62r9SSBXeDASyoD6HHo846EtXGnKr0c_QJSDXrDO-DiAQIoQ8krbYwfttaWOjkyXCHO0tLGgSJAuuFlbxYVZMyvtAM8FHL8758rxWzn2GKG24YdSy6KcmChMznbLPc1MnkiPgKvicPQqZskvgVCAfEIsA_y-g6DqbxyXttXBuMkgE8csk1LZyk=w551-h449&quot; width=&quot;551&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;b&gt;9º passo)&lt;/b&gt; Aguarde a instalação. Veja a imagem abaixo:&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjlPYBWPSH1ZsfMdFciGa9DBNnyFxPDbZKgb8ey1o0QRfFIrg0miYsam5EXVyR9npNzeCGb_O2QZXcZBFGmlgJ3FBr9FjzqCi-HCH37US0Rxlf1v9JeK6kisXa_ZIj5K0ijw49RTuzNOXxUqactdL-9EzAarIrLb60pPamHxA_K1FyNvNPskumPyKWlcz8&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;516&quot; data-original-width=&quot;640&quot; height=&quot;442&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjlPYBWPSH1ZsfMdFciGa9DBNnyFxPDbZKgb8ey1o0QRfFIrg0miYsam5EXVyR9npNzeCGb_O2QZXcZBFGmlgJ3FBr9FjzqCi-HCH37US0Rxlf1v9JeK6kisXa_ZIj5K0ijw49RTuzNOXxUqactdL-9EzAarIrLb60pPamHxA_K1FyNvNPskumPyKWlcz8=w549-h442&quot; width=&quot;549&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;p&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;b&gt;10º passo)&lt;/b&gt;&amp;nbsp; Quando for finalizada a instalação, será aberto uma tela de configuração do gerenciador do Python, com algumas perguntas:&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;/p&gt;&lt;h3 style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;&lt;b&gt;1ª Pergunta)&lt;/b&gt;&amp;nbsp; Se você deseja aumentar a quantidade máxima de caracteres dos caminhos de arquivos (path) do sistema operacional Windows, que atualmente está limitada a 260 caracteres. Essa pergunta só será exibida se os&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;caminhos de arquivos&lt;/span&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;&amp;nbsp;da sua instalação do Windows tiver esta limitação.&lt;/span&gt;&lt;/h3&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&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/a/AVvXsEgm4IqO1ICFyVcpNLFS-j0edfwBO7x1DgSIrB94YxZWh-6oC0tk_fy7yRVNeRyo3TCOalZjAMteyix9LOQK36b3SiJS2yBTYexfvDhGPzsZQVv-jv36Y_NxpfakNYjo-LXK1RVekWU0X-Gd_waNvipR8JxYkoedTquKIr363X8YmC8PxgIcDjrFJubhjhk&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;295&quot; data-original-width=&quot;736&quot; height=&quot;228&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgm4IqO1ICFyVcpNLFS-j0edfwBO7x1DgSIrB94YxZWh-6oC0tk_fy7yRVNeRyo3TCOalZjAMteyix9LOQK36b3SiJS2yBTYexfvDhGPzsZQVv-jv36Y_NxpfakNYjo-LXK1RVekWU0X-Gd_waNvipR8JxYkoedTquKIr363X8YmC8PxgIcDjrFJubhjhk=w570-h228&quot; width=&quot;570&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;p style=&quot;clear: both; text-align: left;&quot;&gt;Neste questionamento é oferecida informações adicionais:&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Alguns pacotes Python criam alguns caminhos de arquivo muito longos.&amp;nbsp;&lt;/li&gt;&lt;li&gt;Caso NÃO for possível criar caminhos de arquivos com mais de 260 caracteres poderá ocorrer erro de instalação ou atualização de pacotes. Para efetivar esta alteração é necessária a permissão de administrador e reinicialização do sistema operacional Windows (&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;Só&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #990000;&quot;&gt;reinicialize o sistema no 11º passo deste tutorial&lt;/span&gt;&lt;/b&gt;).&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;p style=&quot;clear: both; text-align: left;&quot;&gt;Você será questionado se deseja fazer esta configuração agora. Responda:&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;y:&amp;nbsp; sim, para confirmar a alteração. Será aumentado o limite máximo de caracteres do caminho do arquivo.&amp;nbsp;&lt;/li&gt;&lt;li&gt;N: para rejeitar a alteração&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;p style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div&gt;Caso esta alteração seja confirmada, será alterada de forma automática o seguinte registro do Windows:&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #073763;&quot;&gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;De 0 para valor 1. Esta alteração é segura.&lt;/p&gt;&lt;p&gt;Este é o resultado da alteração automática:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhj1_NLhX8mBxudJkgGrbxGxwSupWWkCCLMWRFtmkpJkvMunlge9dZmqviX0PoMdpu0RHu0mpkdKMWxJqrXO8Q6jZZzgMfC8EMZVzMP6gDTrpxPR9rMmMLdvrPXAi9JE6JvKcNLD3nFdt46ia-demqgyQdg0ceInl5dK4-jKMIDpN9gXmtpZqcYan6w_YU&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;444&quot; data-original-width=&quot;650&quot; height=&quot;393&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhj1_NLhX8mBxudJkgGrbxGxwSupWWkCCLMWRFtmkpJkvMunlge9dZmqviX0PoMdpu0RHu0mpkdKMWxJqrXO8Q6jZZzgMfC8EMZVzMP6gDTrpxPR9rMmMLdvrPXAi9JE6JvKcNLD3nFdt46ia-demqgyQdg0ceInl5dK4-jKMIDpN9gXmtpZqcYan6w_YU=w576-h393&quot; width=&quot;576&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;h3 style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;&lt;b&gt;2ª Pergunta)&lt;/b&gt; Se você quer executar o Python, utilizando o comandos opcionais &quot;python3.14.exe&quot; ou &quot;python3.14&quot;, além dos comandos padrões.&lt;/span&gt;&lt;/h3&gt;&lt;p style=&quot;clear: both; text-align: left;&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiQUp2QacX2yPbU0_KhHQFyMp_Znt1Fk_IcM0qzVoZV_oyj-50gFjztHQ7dseaK8300IilxH-zTHeQPq1ZuUJdwryvIafAIayb201Ugx87FXKY_bqgnDBQ1oAEkb1KJ-uEpuFCwyoftBihVfTpzQOuOhhVvFGTt1duddyIdmUmQl1qurTiBmTKCz2QceSk&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;301&quot; data-original-width=&quot;723&quot; height=&quot;229&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiQUp2QacX2yPbU0_KhHQFyMp_Znt1Fk_IcM0qzVoZV_oyj-50gFjztHQ7dseaK8300IilxH-zTHeQPq1ZuUJdwryvIafAIayb201Ugx87FXKY_bqgnDBQ1oAEkb1KJ-uEpuFCwyoftBihVfTpzQOuOhhVvFGTt1duddyIdmUmQl1qurTiBmTKCz2QceSk=w551-h229&quot; width=&quot;551&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p style=&quot;clear: both; text-align: left;&quot;&gt;Os 3 comandos padrões são:&lt;/p&gt;&lt;div style=&quot;clear: both; text-align: left;&quot;&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;python&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;py&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;py -V:3.14&lt;/b&gt; - no seu caso troque o 3.14 pelo número da sua versão. Este comando é indicado quando é utilizada mais de uma versão do Python Instalada.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;p style=&quot;clear: both;&quot;&gt;Importante!!!&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;clear: both; text-align: left;&quot;&gt;O nome do arquivo é formado pela palavra &quot;python&quot; seguido do número da versão, neste caso, 3.14, pois é a versão que está instalada neste PC.&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;clear: both; text-align: left;&quot;&gt;Caso sua versão for posterior, será exibida o número da sua versão.&lt;/p&gt;&lt;p style=&quot;clear: both; text-align: left;&quot;&gt;Está configuração NÃO é necessária, na maioria dos casos.&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;clear: both; text-align: left;&quot;&gt;Caso você confirme com&amp;nbsp; a letra &quot;y&quot;, você poderá executar o Python com os comandos padrões e opcionais. Tem utilidade quando você utiliza mais de uma versão do Python instalada.&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;clear: both; text-align: left;&quot;&gt;Caso você rejeite, digitando a letra &quot;N&quot;. Você poderá executar o Python utilizando somente os comandos padrões.&lt;/p&gt;&lt;p style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEio2FKRzzvK0OqaFwfVjtw5eLg4c8hdiGFyKZ8-th5x2gCQswAh_Z4E1LFiPnZ_DiKlBZbmHCofEv2DdgCgShApM3YARaC6syyrSeaY1eM1-sjdrHGqlvLPdh8kH_U2rYPY5T1ceY8UaDrTPZphzk4LH--PPxxfajHa7LepQIZCh3UqfJtHoYAaYlJtN6E&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;296&quot; data-original-width=&quot;735&quot; height=&quot;228&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEio2FKRzzvK0OqaFwfVjtw5eLg4c8hdiGFyKZ8-th5x2gCQswAh_Z4E1LFiPnZ_DiKlBZbmHCofEv2DdgCgShApM3YARaC6syyrSeaY1eM1-sjdrHGqlvLPdh8kH_U2rYPY5T1ceY8UaDrTPZphzk4LH--PPxxfajHa7LepQIZCh3UqfJtHoYAaYlJtN6E=w563-h228&quot; width=&quot;563&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style=&quot;clear: both; text-align: left;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #990000; font-size: medium;&quot;&gt;Importante!!!&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p style=&quot;clear: both; text-align: left;&quot;&gt;É informado que caso sua escolha seja y (sim) você deve fechar este terminal (&lt;b&gt;&lt;span style=&quot;color: #990000;&quot;&gt;não feche esta tela após a resposta&lt;/span&gt;&lt;/b&gt;, &lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;no final das perguntas esta tela será fechada automaticamente&lt;/b&gt;&lt;/span&gt;) e em seguida, abrir o terminal (&lt;b&gt;&lt;span style=&quot;color: #990000;&quot;&gt;abra o terminal utilizando o Prompt de Comando ou Powershell, somente no final deste tutorial&lt;/span&gt;&lt;/b&gt;) .&lt;/p&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;p style=&quot;text-align: left;&quot;&gt;Caso esta alteração seja confirmada, será incluído automaticamente na &quot;&lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;variável de ambiente Path do Windows&lt;/b&gt;&lt;/span&gt;&quot;, o caminho de arquivo do executável do Python. Veja o resultado desta alteração na imagem abaixo:&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;Neste exemplo, foi incluído na variável Path o caminho do executável (arquivo .exe) do Python:&lt;br /&gt;C:\Users\kelly\AppData\Local\Python\bin&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #990000;&quot;&gt;No seu caso, ao invés do usuário &quot;kelly&quot; será exibido o seu nome de usuário do Windows.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;Este é o resultado da alteração automática:&lt;/p&gt;&lt;p&gt;&lt;/p&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/a/AVvXsEhjx9Q9Aa-p9Qv_APkP-qxTgPsD7UruVXwyyikaG_ktS_TQbBIaQJJRlVUEoh36K4KiPPu0aWieUtekwAi3WCt6AcmyAOAr0o7BvJeFXEVQNgv6h0WuTqCVmC1ds6MMrhX2ZTx50yXeTdpcbCFtDnIZdDdI44y7aTBh5pw5G9MmwS_h22RzkIJOhEygEJs&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img data-original-height=&quot;673&quot; data-original-width=&quot;616&quot; height=&quot;613&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhjx9Q9Aa-p9Qv_APkP-qxTgPsD7UruVXwyyikaG_ktS_TQbBIaQJJRlVUEoh36K4KiPPu0aWieUtekwAi3WCt6AcmyAOAr0o7BvJeFXEVQNgv6h0WuTqCVmC1ds6MMrhX2ZTx50yXeTdpcbCFtDnIZdDdI44y7aTBh5pw5G9MmwS_h22RzkIJOhEygEJs=w561-h613&quot; width=&quot;561&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p style=&quot;clear: both;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;p style=&quot;clear: both; text-align: left;&quot;&gt;&lt;b&gt;Observações&lt;/b&gt;&lt;/p&gt;&lt;p style=&quot;clear: both; text-align: left;&quot;&gt;Também é informado que caso você faça a &lt;b&gt;&lt;span style=&quot;color: #990000;&quot;&gt;desinstalação completa da instalação do Python&lt;/span&gt;&lt;/b&gt; utilizando o comando:&amp;nbsp;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #073763;&quot;&gt;py uninstall --purge&lt;/span&gt;&amp;nbsp;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;p style=&quot;clear: both; text-align: left;&quot;&gt;O caminho de arquivo do Python também será excluído da variável path do Windows.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Caso desinstale o Python manualmente, você poderá remover o caminho do arquivo da variável Path manualmente também.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;&lt;b&gt;3ª Pergunta)&lt;/b&gt;&amp;nbsp; Se você quer instalar agora a versão mais nova do Python.&amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;Se não quiser, pode instalar depois com o comando abaixo (utilizando o Prompt de Comando do Windows ou Windows PowerShell)&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/h3&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;color: #073763;&quot;&gt;py install default&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjcsc-QhyPPVW6_QHoA1dQV2AN11kx1l_j2iIk1A-5xu4axDp2uT6kWOwnJWbv7ss9JQRIUd1heY1z4x16CVeNGc4m3IEsuWSYwgc-HEZ_QWrxyMqdrxOMYRcyPG1L2iFKolJTSNP2LBiz3LEWhlTxherJhr-CYsKhJFepctNfPGiN0LvuoGFrpeIO6FgM&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;179&quot; data-original-width=&quot;723&quot; height=&quot;146&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjcsc-QhyPPVW6_QHoA1dQV2AN11kx1l_j2iIk1A-5xu4axDp2uT6kWOwnJWbv7ss9JQRIUd1heY1z4x16CVeNGc4m3IEsuWSYwgc-HEZ_QWrxyMqdrxOMYRcyPG1L2iFKolJTSNP2LBiz3LEWhlTxherJhr-CYsKhJFepctNfPGiN0LvuoGFrpeIO6FgM=w591-h146&quot; width=&quot;591&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p style=&quot;text-align: left;&quot;&gt;Se você responder:&lt;br /&gt;&lt;/p&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;y&lt;/b&gt;: sim, será iniciada a instalação.&lt;/li&gt;&lt;li&gt;&lt;b&gt;N&lt;/b&gt;: não será executada a instalação.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;br /&gt;Veja o retorno da instalação:&lt;p&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiYh5G2tBGGeUTBy2qBaZsbSmbRrxu_KBmnQj7mh9F4oGHff8PNv0UosjqAzpYVwvfqayAlLG6gBaNg3nLlO7staX7wiZ9AmYKus5dZhfA_WU8k-HfZ9WD5e5j8IYhAFOJ9-gbfaQ3fKXSg3vJ5nn1rJqQJL4iM5SHJPwUeC_f_6oHaIdcKiuAaEXGO0KE&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;721&quot; data-original-width=&quot;594&quot; height=&quot;713&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiYh5G2tBGGeUTBy2qBaZsbSmbRrxu_KBmnQj7mh9F4oGHff8PNv0UosjqAzpYVwvfqayAlLG6gBaNg3nLlO7staX7wiZ9AmYKus5dZhfA_WU8k-HfZ9WD5e5j8IYhAFOJ9-gbfaQ3fKXSg3vJ5nn1rJqQJL4iM5SHJPwUeC_f_6oHaIdcKiuAaEXGO0KE=w587-h713&quot; width=&quot;587&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p style=&quot;text-align: left;&quot;&gt;Após a instalação, será informado:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;A url do manual instalação e configuração do Python para usuários do sistema operacional Windows : &lt;a href=&quot;https://docs.python.org/dev/using/windows&quot; target=&quot;_blank&quot;&gt;https://docs.python.org/dev/using/windows&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;Digite &quot;y&quot;:&lt;/b&gt; para abrir esta url no Browser (navegador) imediatamente.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Digite &quot;N&quot;:&lt;/b&gt; caso NÃO queira abrir. Você poderá consultar a qualquer momento a url, acessando através do Browser (Google Chrome, Firefox, Edge, etc).&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;p style=&quot;text-align: left;&quot;&gt;Na parte superior da tela, você pode trocar o idioma do manual para Português brasileiro (ver destaque em vermelho na imagem) e versão do Python (ver destaque em laranja na imagem).&lt;/p&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiBrXvqZrgNNF1rV4iE5UYjREAgaaRDu2ahLSSMra4VEIV-vjMcIzu_udASa_bltFnjuNG9ciGcv2KLpfFziS9QGYFykH4TVoS4qMC4-XvJx2z2fSiDRCEvQj0wzZbh6hOtipyuYHcxG0Qb3bzXt8zjj6KvtUKN4ahhXSBYq1s4sUmAhYMFVBoT5RBl5bM&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;510&quot; data-original-width=&quot;757&quot; height=&quot;403&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiBrXvqZrgNNF1rV4iE5UYjREAgaaRDu2ahLSSMra4VEIV-vjMcIzu_udASa_bltFnjuNG9ciGcv2KLpfFziS9QGYFykH4TVoS4qMC4-XvJx2z2fSiDRCEvQj0wzZbh6hOtipyuYHcxG0Qb3bzXt8zjj6KvtUKN4ahhXSBYq1s4sUmAhYMFVBoT5RBl5bM=w598-h403&quot; width=&quot;598&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;Após a resposta, a tela do &quot;Python Install Manager&quot; será fechada automaticamente.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;11º Passo) &lt;/b&gt;Agora reinicie o sistema operacional Windows. Importante!!! Antes de reiniciar não se esqueça de salvar algum arquivo que esteja alterando no momento.&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;12º Passo) &lt;/b&gt;Após a reinicialização, você deve abrir o Prompt de Comando ou Windows PowerShell, em seguida, executar os comandos abaixo com a finalidade de teste.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Exemplo no Prompt de Comando:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhxf5tApGyYQj8bwdh5xfrs_Vd8P_s__ZFSn91iBlFe2tExpXjN9rrOBjiidjlyFvqZcvcnXIE8E9hdIHBjDz7QUkQY3Sm9f90nRqqqZhrmjkocNIn1x3z4HGhabwKbpoZcDT9ZkK-DyNyiVR047CdPcLFjce37TNorb68l4OhYyzXaNgGaTHQ4RysWW5I&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;374&quot; data-original-width=&quot;603&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhxf5tApGyYQj8bwdh5xfrs_Vd8P_s__ZFSn91iBlFe2tExpXjN9rrOBjiidjlyFvqZcvcnXIE8E9hdIHBjDz7QUkQY3Sm9f90nRqqqZhrmjkocNIn1x3z4HGhabwKbpoZcDT9ZkK-DyNyiVR047CdPcLFjce37TNorb68l4OhYyzXaNgGaTHQ4RysWW5I=s16000&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Exemplo no&amp;nbsp; Windows PowerShell:&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhNdxpD8JlMZ3FRSAko1mOd6P3bPVEHDbNni7TT_B0gHPZI0DvAdlGwL3aSrZXh0oUQbzxFxxFegQ2WO5uo-L81ZhueL-jcPLn6IEqsyq-biXEgVjwDBuBufpqPgn9PxXcjDAXCDBW79oBTt3e9p9ErNAMbmq0IM359LxI2yqU8axQ3UEVtqiMDJGkiyqY&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;381&quot; data-original-width=&quot;619&quot; height=&quot;369&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhNdxpD8JlMZ3FRSAko1mOd6P3bPVEHDbNni7TT_B0gHPZI0DvAdlGwL3aSrZXh0oUQbzxFxxFegQ2WO5uo-L81ZhueL-jcPLn6IEqsyq-biXEgVjwDBuBufpqPgn9PxXcjDAXCDBW79oBTt3e9p9ErNAMbmq0IM359LxI2yqU8axQ3UEVtqiMDJGkiyqY=w599-h369&quot; width=&quot;599&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;</content><link rel='replies' type='application/atom+xml' href='http://jquerydicas.blogspot.com/feeds/5290194207779477921/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://jquerydicas.blogspot.com/2025/12/instalacao-do-python-install-manager-no.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/5290194207779477921'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/5290194207779477921'/><link rel='alternate' type='text/html' href='http://jquerydicas.blogspot.com/2025/12/instalacao-do-python-install-manager-no.html' title='Instalação do Python Install Manager no Windows 11'/><author><name>Kelly</name><uri>http://www.blogger.com/profile/03449060135636479990</uri><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/a/AVvXsEjxRCEO8E5KKOKNHLwRAO6V9v7FpHYbb3RtpMwHyPeHqAyQcSxhfS11p2RWV6JaCzdO6vTykN-n8pIa3iNRQ48Cd9Slwn-YU8eqaDnMP0DFdhdiGcuxtdblJV2ahVJHIS6NeEh4Mcrhto8eYaxvZoBpntoFq-tKmaHDsKmMeP4tnxPQurWja7yfi6vzG0U=s72-c" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>Londrina, PR, Brasil</georss:featurename><georss:point>-23.3197305 -51.1662008</georss:point><georss:box>-51.629964336178844 -86.3224508 4.9905033361788469 -16.0099508</georss:box></entry><entry><id>tag:blogger.com,1999:blog-7010404629734647455.post-2759377374109183973</id><published>2025-12-06T20:06:00.003-03:00</published><updated>2025-12-06T20:15:15.899-03:00</updated><title type='text'>Mostrar arquivos e diretórios ocultos no Windows 11 </title><content type='html'>&lt;p&gt;Neste post é descrito o passo a passo para mostrar arquivos e diretórios ocultos (escondidos).&lt;/p&gt;&lt;p&gt;Veja o exemplo descrito abaixo ou caso prefira veja o vídeo no &lt;a href=&quot;https://youtu.be/hQzp7jbdGHo&quot; target=&quot;_blank&quot;&gt;Youtube&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;iframe allowfullscreen=&quot;&quot; class=&quot;BLOG_video_class&quot; height=&quot;380&quot; src=&quot;https://www.youtube.com/embed/hQzp7jbdGHo&quot; width=&quot;518&quot; youtube-src-id=&quot;hQzp7jbdGHo&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;b&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;Exemplo&lt;/b&gt;&lt;/h2&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;No diretório chamado &quot;Diversos&quot; há dois itens ocultos: um arquivo e um diretório.&lt;/p&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;1 diretório chamado: &quot;&lt;b&gt;Diretório teste oculto&lt;/b&gt;&quot;&lt;/li&gt;&lt;li&gt;1 arquivo chamado: &quot;&lt;b&gt;Arquivo teste oculto.txt&lt;/b&gt;&quot;&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEi6BXMrxWwsqGylTbw2V6aeSnZyL6DcqBes4pXl3ZAEoguyU4BB3iLy6qDO00cNRI93s497kScdSVzfvA6CbIxwL6uRtNBOzOO9q-cyVeXFw24C_2Qp1Cadfc4-sd_etpXCnDJIYkJSzF5_ICKUnaxFKc8zFIzknZJ_XiKqDO_WjouUX1gO3Inw1UKDZMs&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;465&quot; data-original-width=&quot;575&quot; height=&quot;441&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEi6BXMrxWwsqGylTbw2V6aeSnZyL6DcqBes4pXl3ZAEoguyU4BB3iLy6qDO00cNRI93s497kScdSVzfvA6CbIxwL6uRtNBOzOO9q-cyVeXFw24C_2Qp1Cadfc4-sd_etpXCnDJIYkJSzF5_ICKUnaxFKc8zFIzknZJ_XiKqDO_WjouUX1gO3Inw1UKDZMs=w545-h441&quot; width=&quot;545&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;Para exibi-los, você deve clicar no menu &quot;&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;Visualizar&lt;/b&gt;&lt;/span&gt;&quot;, em seguida, &quot;&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;Mostrar&lt;/b&gt;&lt;/span&gt;&quot;, depois você vai marcar &quot;&lt;b&gt;&lt;span style=&quot;color: #990000;&quot;&gt;Itens ocultos&lt;/span&gt;&lt;/b&gt;&quot;.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;img alt=&quot;Fazendo upload: 219531 de 219531 bytes.&quot; border=&quot;0&quot; class=&quot;placeholder&quot; id=&quot;b0aa24b6f5487&quot; src=&quot;https://www.blogger.com/img/transparent.gif&quot; style=&quot;background-color: #d8d8d8; background-image: url(&#39;https://fonts.gstatic.com/s/i/materialiconsextended/insert_photo/v6/grey600-24dp/1x/baseline_insert_photo_grey600_24dp.png&#39;); background-position: 50% 50%; background-repeat: no-repeat; opacity: 0.6;&quot; /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgIThsz6CKJRpdayLUfE1GgKM5dh3x9SO59hZRZBOfw2_olCdKob-nmNAq0vfiQkT00g3OkRqzDP8TRdXIWWIjHPVV2JMK42q8OqjpQ_ts9H8Cfg4h3XmkEoFg0mCKfhYV-jGkhU1LJjlOaMlPEXvt-JxDji50XmcxZ6OjR9k5SwUKHWjUlCBAFpcJo3xo&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;591&quot; data-original-width=&quot;723&quot; height=&quot;448&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgIThsz6CKJRpdayLUfE1GgKM5dh3x9SO59hZRZBOfw2_olCdKob-nmNAq0vfiQkT00g3OkRqzDP8TRdXIWWIjHPVV2JMK42q8OqjpQ_ts9H8Cfg4h3XmkEoFg0mCKfhYV-jGkhU1LJjlOaMlPEXvt-JxDji50XmcxZ6OjR9k5SwUKHWjUlCBAFpcJo3xo=w549-h448&quot; width=&quot;549&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Os itens ocultos serão exibidos. Perceba que a cor do diretório oculto e do arquivo oculto é mais clara. Veja a imagem abaixo:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhq5wtNAV_bl8mjoS5pKEQaU8InwXx6-9euoZZ_X8jSCgXORjmwM-2CbDWb7h3rP1y8FonJyV1zokaOnFXaVA1eQ4rDN22WcvYRsGBKAJSn_e3lDqiv3PmDOFrs-IZC89EzRLcdPC-tpHA5C5Uu9VDRQ8982lBSyftoW6a6DxNfz5gsZjNzH42P2qpeOgc&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;&quot; data-original-height=&quot;524&quot; data-original-width=&quot;590&quot; height=&quot;485&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhq5wtNAV_bl8mjoS5pKEQaU8InwXx6-9euoZZ_X8jSCgXORjmwM-2CbDWb7h3rP1y8FonJyV1zokaOnFXaVA1eQ4rDN22WcvYRsGBKAJSn_e3lDqiv3PmDOFrs-IZC89EzRLcdPC-tpHA5C5Uu9VDRQ8982lBSyftoW6a6DxNfz5gsZjNzH42P2qpeOgc=w546-h485&quot; width=&quot;546&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Caso queira que sejam ocultos novamente, clique novamente no menu &quot;&lt;b&gt;&lt;span style=&quot;color: #990000;&quot;&gt;Visualizar&lt;/span&gt;&lt;/b&gt;&quot;, em seguida, &quot;&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;Mostrar&lt;/b&gt;&lt;/span&gt;&quot;, depois você vai desmarcar &quot;&lt;b&gt;&lt;span style=&quot;color: #990000;&quot;&gt;Itens ocultos&lt;/span&gt;&lt;/b&gt;&quot;.&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjnp_AgHeiSQ6klQ6cvJXlqa8nGWctZ7yyd6HPInMs94nTvmO-WPmokw5k5_E6LabxrrmfvTKiJ7AWKuMKNA-Jz1Csk7dn5KiUtAxWLT7nSdP0HZW1AH1_L7y2akZ60U0vX-DHAPgdgXY2qNUf3_49vrh-nAKTjJtFGvoLNAjQrUfWd8c2tTnBlZ4CqpLw&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;1007&quot; data-original-width=&quot;1233&quot; height=&quot;453&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjnp_AgHeiSQ6klQ6cvJXlqa8nGWctZ7yyd6HPInMs94nTvmO-WPmokw5k5_E6LabxrrmfvTKiJ7AWKuMKNA-Jz1Csk7dn5KiUtAxWLT7nSdP0HZW1AH1_L7y2akZ60U0vX-DHAPgdgXY2qNUf3_49vrh-nAKTjJtFGvoLNAjQrUfWd8c2tTnBlZ4CqpLw=w554-h453&quot; width=&quot;554&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://jquerydicas.blogspot.com/feeds/2759377374109183973/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://jquerydicas.blogspot.com/2025/12/mostrar-arquivos-e-diretorios-ocultos.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/2759377374109183973'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/2759377374109183973'/><link rel='alternate' type='text/html' href='http://jquerydicas.blogspot.com/2025/12/mostrar-arquivos-e-diretorios-ocultos.html' title='Mostrar arquivos e diretórios ocultos no Windows 11 '/><author><name>Kelly</name><uri>http://www.blogger.com/profile/03449060135636479990</uri><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://img.youtube.com/vi/hQzp7jbdGHo/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7010404629734647455.post-3396789798253056298</id><published>2025-12-04T17:04:00.007-03:00</published><updated>2025-12-04T22:00:29.532-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Windows"/><title type='text'>Mostrar ou ocultar extensões de arquivos do Windows 11</title><content type='html'>&lt;p&gt;Veja o passo a passo abaixo, caso tenha interesse assista o vídeo no &lt;a href=&quot;https://youtu.be/HFLmQK2Gy4o&quot; target=&quot;_blank&quot;&gt;YouTube&lt;/a&gt;. Também está disponível no formato &lt;a href=&quot;https://youtube.com/shorts/yyoBZbbOHfc?feature=share&quot; target=&quot;_blank&quot;&gt;Shorts&lt;/a&gt;.&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;iframe allowfullscreen=&quot;&quot; class=&quot;BLOG_video_class&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/HFLmQK2Gy4o&quot; width=&quot;558&quot; youtube-src-id=&quot;HFLmQK2Gy4o&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;Para mostrar as extensões de arquivos do Windows, exemplo: .jpeg, .mp4, .exe você deve:&lt;/h3&gt;&lt;p&gt;&lt;b&gt;1º Passo)&lt;/b&gt;&amp;nbsp;Vá para o menu, clique em &quot;&lt;b&gt;&lt;span style=&quot;color: #990000;&quot;&gt;Visualizar&lt;/span&gt;&lt;/b&gt;&quot;, em seguida, &quot;&lt;b&gt;&lt;span style=&quot;color: #990000;&quot;&gt;Mostrar&lt;/span&gt;&lt;/b&gt;&quot;, marque o item &quot;&lt;b&gt;&lt;span style=&quot;color: #990000;&quot;&gt;Extensões de nome de arquivos&lt;/span&gt;&lt;/b&gt;&quot;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjBuYEzykpVsdOFQEzjqSl79u_sufs-DV7caX6HeqfG4AWDGKKY8acmWZoncBMv0wqW5NXW2b8mtr88pkNFpPO47IVS7hZ847kOteiMLW-KqXdBXR-G_tz9jWx0Qa4-HgvsQfnQLErOQUuGSlwh28c1JRj7DV_rr7Gj0vgPYWvIeBuTdDrhnb0D4o6w1-A&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;554&quot; data-original-width=&quot;838&quot; height=&quot;357&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjBuYEzykpVsdOFQEzjqSl79u_sufs-DV7caX6HeqfG4AWDGKKY8acmWZoncBMv0wqW5NXW2b8mtr88pkNFpPO47IVS7hZ847kOteiMLW-KqXdBXR-G_tz9jWx0Qa4-HgvsQfnQLErOQUuGSlwh28c1JRj7DV_rr7Gj0vgPYWvIeBuTdDrhnb0D4o6w1-A=w542-h357&quot; width=&quot;542&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;2º Passo)&lt;/b&gt; Veja o resultado na imagem abaixo, as extensões serão exibidas.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgiVvbnXvGMAKQfQCJukWYVi4FUADvGVwtZ5tA_4jN3DJoj2fdogw-vI4rJJL3fw-3v_daBwsorU8mTjbycyXJu2BxFmaHHwFq4HlFMI1aZfJZ9R8Ztf4Fmid3PEJsj6Y0h1q_if6cdtjsAl9N_S6w_1HzcJCmL_rNiZseEFXQibkCDPKPKsZhiKJMmHis&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;396&quot; data-original-width=&quot;538&quot; height=&quot;396&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgiVvbnXvGMAKQfQCJukWYVi4FUADvGVwtZ5tA_4jN3DJoj2fdogw-vI4rJJL3fw-3v_daBwsorU8mTjbycyXJu2BxFmaHHwFq4HlFMI1aZfJZ9R8Ztf4Fmid3PEJsj6Y0h1q_if6cdtjsAl9N_S6w_1HzcJCmL_rNiZseEFXQibkCDPKPKsZhiKJMmHis=w538-h396&quot; width=&quot;538&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/h3&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;Caso você queira ocultá-las, você deve:&lt;/h3&gt;&lt;p&gt;&lt;b&gt;1º Passo)&lt;/b&gt;&amp;nbsp;Vá para o menu, clique em &quot;&lt;b&gt;&lt;span style=&quot;color: #990000;&quot;&gt;Visualizar&lt;/span&gt;&lt;/b&gt;&quot;, em seguida, &quot;&lt;b&gt;&lt;span style=&quot;color: #990000;&quot;&gt;Mostrar&lt;/span&gt;&lt;/b&gt;&quot;, desmarque o item &lt;b&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&quot;Extensões de nome de arquivos&lt;/span&gt;&lt;/b&gt;&quot;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhOGIRkyhoZtfeDdghc83CefoSsOSzmuGLu3NT4xr0qRHJcny5fbWp0M-uGiFnqKaC3KzhTnIdd9NfAnr-TLmXfHNS1Fongs-_r6HgKMPEgKv4TrQstZEYDrM__n-H3pJYYHiyR3sOt7UzcRdhAvCW7aL9vLKOoM7uiYC51eHzamb-fu4fcjX65BeNodRg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;641&quot; data-original-width=&quot;971&quot; height=&quot;354&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhOGIRkyhoZtfeDdghc83CefoSsOSzmuGLu3NT4xr0qRHJcny5fbWp0M-uGiFnqKaC3KzhTnIdd9NfAnr-TLmXfHNS1Fongs-_r6HgKMPEgKv4TrQstZEYDrM__n-H3pJYYHiyR3sOt7UzcRdhAvCW7aL9vLKOoM7uiYC51eHzamb-fu4fcjX65BeNodRg=w538-h354&quot; width=&quot;538&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;2º Passo)&lt;/b&gt; Veja o resultado na imagem abaixo, as extensões serão ocultas (não serão mais exibidas).&lt;/p&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEib6w8wsOsgU7CecSdtfNwnUYR7ZdImQgMQrq-bjvAbNQ1QkWNCY13aJYQjnpEDfyOjqGO8sMttT6mioJMotSjfUY-eNdaeMLejGJ-eTdzBbJMjhewBH_eoOHuXwWm2bZibW8kTpUQCZtV3nNV-Y47q7pgNWE_GhkgjWbe35Q4IG2GVElc3D_YnfeCYQV4&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;398&quot; data-original-width=&quot;530&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEib6w8wsOsgU7CecSdtfNwnUYR7ZdImQgMQrq-bjvAbNQ1QkWNCY13aJYQjnpEDfyOjqGO8sMttT6mioJMotSjfUY-eNdaeMLejGJ-eTdzBbJMjhewBH_eoOHuXwWm2bZibW8kTpUQCZtV3nNV-Y47q7pgNWE_GhkgjWbe35Q4IG2GVElc3D_YnfeCYQV4=s16000&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jquerydicas.blogspot.com/feeds/3396789798253056298/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://jquerydicas.blogspot.com/2025/12/mostrar-ou-ocultar-extensoes-de.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/3396789798253056298'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/3396789798253056298'/><link rel='alternate' type='text/html' href='http://jquerydicas.blogspot.com/2025/12/mostrar-ou-ocultar-extensoes-de.html' title='Mostrar ou ocultar extensões de arquivos do Windows 11'/><author><name>Kelly</name><uri>http://www.blogger.com/profile/03449060135636479990</uri><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://img.youtube.com/vi/HFLmQK2Gy4o/default.jpg" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>Londrina, PR, Brasil</georss:featurename><georss:point>-23.3197305 -51.1662008</georss:point><georss:box>-51.629964336178844 -86.3224508 4.9905033361788469 -16.0099508</georss:box></entry><entry><id>tag:blogger.com,1999:blog-7010404629734647455.post-3387452785953692548</id><published>2025-11-27T08:49:00.002-03:00</published><updated>2025-11-27T08:50:29.199-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Windows"/><title type='text'>Ocultar ou mostrar ícones da área de trabalho do Windows</title><content type='html'>&lt;p&gt;Este passo a passo ensina a ocultar (esconder) ou mostrar os ícones da área de trabalho do Windows.&lt;/p&gt;&lt;p&gt;Caso prefira, assista o vídeo no &lt;a href=&quot;https://youtu.be/LjGzI1wDVgk&quot;&gt;YouTube&lt;/a&gt;.&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;iframe allowfullscreen=&quot;&quot; class=&quot;BLOG_video_class&quot; height=&quot;435&quot; src=&quot;https://www.youtube.com/embed/LjGzI1wDVgk&quot; width=&quot;525&quot; youtube-src-id=&quot;LjGzI1wDVgk&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Ocultar (esconder) os ícones da área de trabalho&lt;/h2&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEg-2g1GtUyRsjxYQpkS1mjIlYzBG4LMyIIxDt3QdVdX33dAf78ehrYwFW_TYx5U-Ttw-yPqmEPfAuJwxMDlz4RJpZA5SZhyBL1tQ_hMZ8An8l5xgb5tyRwcBN79sFUWUgIbb_APdHNnfaCXCkKjvg5iQumEZQTcyk_ceHWT-7mxRIXUPuRT55UMvsoAd7c&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;540&quot; data-original-width=&quot;960&quot; height=&quot;288&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEg-2g1GtUyRsjxYQpkS1mjIlYzBG4LMyIIxDt3QdVdX33dAf78ehrYwFW_TYx5U-Ttw-yPqmEPfAuJwxMDlz4RJpZA5SZhyBL1tQ_hMZ8An8l5xgb5tyRwcBN79sFUWUgIbb_APdHNnfaCXCkKjvg5iQumEZQTcyk_ceHWT-7mxRIXUPuRT55UMvsoAd7c=w512-h288&quot; width=&quot;512&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;b&gt;a)&amp;nbsp;&lt;/b&gt;Clique com o &lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;botão direito do mouse&lt;/span&gt;&lt;/b&gt; na área de trabalho.&lt;/p&gt;&lt;b&gt;b)&lt;/b&gt; Escolha a opção &lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&quot;Exibir&quot;&lt;/span&gt;&lt;/b&gt;.&lt;b&gt;&amp;nbsp;&lt;/b&gt;Em seguida, &lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;desmarque&lt;/span&gt;&lt;/b&gt;&amp;nbsp;a opção &lt;b&gt;&quot;&lt;span style=&quot;color: #0b5394;&quot;&gt;Mostrar ícones da área de trabalho&quot;&lt;/span&gt;&lt;/b&gt;.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEh9nAQXCyoJJCZttMx3S990AcsIqsT07YGMO2uSUZGTWlKkM6zN5R1aENGKVp3GFTzjV0CzWzkZfEFyOxFzDAEbMqPznJg4XXlyom3VM-9bp92tZC0eY8qwEGe8vpgRTldEGRwN2AbbFc0JNai5XfpWU3mtpKhwNX31w1owHUaFcnd9sfowFWNcrKXwYpI&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;496&quot; data-original-width=&quot;755&quot; height=&quot;327&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEh9nAQXCyoJJCZttMx3S990AcsIqsT07YGMO2uSUZGTWlKkM6zN5R1aENGKVp3GFTzjV0CzWzkZfEFyOxFzDAEbMqPznJg4XXlyom3VM-9bp92tZC0eY8qwEGe8vpgRTldEGRwN2AbbFc0JNai5XfpWU3mtpKhwNX31w1owHUaFcnd9sfowFWNcrKXwYpI=w498-h327&quot; width=&quot;498&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;Veja o resultado:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgVPkTQt3ANNw_0oRBoyfl-w4SdYzdXn_IrwoUKTcCzk3uEQ7fR5z2SX3u_2vPLD00DtzN9gOMFrZxa6IpxxVvguC549wkHRbrI_mhEOeJs77B0tHMV6k5W_60eWG2Fu7ASE3eO0IoeurJObQ561ku1CQ9sE4SRlwcBRwzKYpA1dxe2mlRrv_gFvpb40bI&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;&quot; data-original-height=&quot;432&quot; data-original-width=&quot;768&quot; height=&quot;283&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgVPkTQt3ANNw_0oRBoyfl-w4SdYzdXn_IrwoUKTcCzk3uEQ7fR5z2SX3u_2vPLD00DtzN9gOMFrZxa6IpxxVvguC549wkHRbrI_mhEOeJs77B0tHMV6k5W_60eWG2Fu7ASE3eO0IoeurJObQ561ku1CQ9sE4SRlwcBRwzKYpA1dxe2mlRrv_gFvpb40bI=w503-h283&quot; width=&quot;503&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Mostrar ícones da área de trabalho&lt;/h2&gt;&lt;p&gt;&lt;b&gt;a)&lt;/b&gt;&amp;nbsp;Clique com o &lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;b&gt;botão direito&lt;/b&gt;&lt;/span&gt; do mouse na área de trabalho.&lt;/p&gt;&lt;p&gt;&lt;b&gt;b)&lt;/b&gt;&amp;nbsp;Escolher a opção &lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&quot;Exibir&quot;&lt;/span&gt;&lt;/b&gt;.&lt;b&gt;&amp;nbsp;&lt;/b&gt;Em seguida, &lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;marque&lt;/span&gt;&lt;/b&gt;&amp;nbsp;a opção &lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&quot;Mostrar ícones da área de trabalho&quot;&lt;/span&gt;&lt;/b&gt;.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgnoU3OwPx6Fi6wN2tX7W4c7krMf7BHHii-fbeJcR6_vUObMWo8VVESw7X8kF4CbzYlttMd5I29iWy9w4gDIofSnTxTx7nHsvJp6i1azFcckb6zMj4SKd3WXvipPi9uVaUZSU5hxWCsuLt9SQ2XEi3Kllmw0I_Zl_K5-rS_0GF0bpnKnHL41Z6JCk9e8pI&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;1080&quot; data-original-width=&quot;1920&quot; height=&quot;287&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgnoU3OwPx6Fi6wN2tX7W4c7krMf7BHHii-fbeJcR6_vUObMWo8VVESw7X8kF4CbzYlttMd5I29iWy9w4gDIofSnTxTx7nHsvJp6i1azFcckb6zMj4SKd3WXvipPi9uVaUZSU5hxWCsuLt9SQ2XEi3Kllmw0I_Zl_K5-rS_0GF0bpnKnHL41Z6JCk9e8pI=w510-h287&quot; width=&quot;510&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Veja o resultado:&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEg-2g1GtUyRsjxYQpkS1mjIlYzBG4LMyIIxDt3QdVdX33dAf78ehrYwFW_TYx5U-Ttw-yPqmEPfAuJwxMDlz4RJpZA5SZhyBL1tQ_hMZ8An8l5xgb5tyRwcBN79sFUWUgIbb_APdHNnfaCXCkKjvg5iQumEZQTcyk_ceHWT-7mxRIXUPuRT55UMvsoAd7c&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;540&quot; data-original-width=&quot;960&quot; height=&quot;284&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEg-2g1GtUyRsjxYQpkS1mjIlYzBG4LMyIIxDt3QdVdX33dAf78ehrYwFW_TYx5U-Ttw-yPqmEPfAuJwxMDlz4RJpZA5SZhyBL1tQ_hMZ8An8l5xgb5tyRwcBN79sFUWUgIbb_APdHNnfaCXCkKjvg5iQumEZQTcyk_ceHWT-7mxRIXUPuRT55UMvsoAd7c=w504-h284&quot; width=&quot;504&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jquerydicas.blogspot.com/feeds/3387452785953692548/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://jquerydicas.blogspot.com/2025/11/ocultar-ou-mostrar-icones-da-area-de.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/3387452785953692548'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/3387452785953692548'/><link rel='alternate' type='text/html' href='http://jquerydicas.blogspot.com/2025/11/ocultar-ou-mostrar-icones-da-area-de.html' title='Ocultar ou mostrar ícones da área de trabalho do Windows'/><author><name>Kelly</name><uri>http://www.blogger.com/profile/03449060135636479990</uri><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://img.youtube.com/vi/LjGzI1wDVgk/default.jpg" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>Londrina, PR, Brasil</georss:featurename><georss:point>-23.3197305 -51.1662008</georss:point><georss:box>-51.629964336178844 -86.3224508 4.9905033361788469 -16.0099508</georss:box></entry><entry><id>tag:blogger.com,1999:blog-7010404629734647455.post-269464667939830328</id><published>2025-11-25T10:16:00.031-03:00</published><updated>2025-11-25T11:34:44.206-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Windows"/><title type='text'>Criar uma nova partição com o Gerenciador de Disco no Windows</title><content type='html'>&lt;p&gt;Neste artigo, vamos dar um exemplo de criação de uma nova partição (divisão) de disco.&amp;nbsp;&lt;/p&gt;&lt;p&gt;O Gerenciador de Disco serve para criar partições em&amp;nbsp; HD ou&amp;nbsp;SSD.&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;b&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;Tanto o HD quanto SSD serão tratados como disco&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;pelo sistema operacional do Windows, apesar do HD ser basicamente formado por discos magnéticos giratórios com uma agulha de leitura e gravação e o SSD ser formado por memória flash (um pen drive com uma grande capacidade de armazenamento mas sem parte móveis).&lt;/p&gt;&lt;p&gt;Vamos dar um exemplo de criação de uma nova partição de disco. Este disco tem o volume &quot;C:&quot; que armazena o sistema operacional&amp;nbsp; Windows e os arquivos pessoais. Vamos criar uma novo volume que será chamado de &quot;D:&quot; para&amp;nbsp; armazenar somente os arquivos pessoais.&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;Na prática vamos diminuir o tamanho do volume &quot;C:&quot; para ter espaço disponível para poder criar um novo volume o &quot;D:&quot;.&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Para isso devemos fazer algumas verificações e procedimentos. Este procedimento foi dividido em 8 passos.&amp;nbsp;&lt;/p&gt;&lt;p&gt;Veja o tutorial abaixo passo a passo ou assista o vídeo no &lt;a href=&quot;https://youtu.be/jH0cc_U1lRo&quot;&gt;Youtube&lt;/a&gt;.&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;iframe allowfullscreen=&quot;&quot; class=&quot;BLOG_video_class&quot; height=&quot;477&quot; src=&quot;https://www.youtube.com/embed/jH0cc_U1lRo&quot; width=&quot;574&quot; youtube-src-id=&quot;jH0cc_U1lRo&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h2&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;1º Passo - Faça Backup&lt;/span&gt;&lt;/h2&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #990000;&quot;&gt;É aconselhável que você faça backup (cópia de segurança dos seus arquivos). Não ignore esta etapa. A segurança dos seus dados é fundamental.&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;Apesar da redução de disco ser geralmente segura, as operações de manipulação de partições do disco estão sujeitas a problemas de perda de dados, caso ocorra algo inesperado como:&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Uma queda de energia&lt;/li&gt;&lt;li&gt;Um erro de software.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;O ideal é usar uma combinação de métodos:&lt;/p&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;Crie uma imagem de sistema operacional&lt;/b&gt;:&lt;b&gt; &lt;/b&gt;utilize uma Ferramentas do Windows como &quot;Backup e Restauração&quot; do Painel de Controle ou um software de terceiros, salvando esta imagem em um local seguro, preferencialmente um disco externo diferente.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Copie ou Sincronize seus arquivos pessoais para um serviço de nuvem&lt;/b&gt;: (como Google Drive, Microsoft OneDrive, Dropbox, iCloud, etc) ou um disco rígido externo.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;2º Passo - Abra o gerenciador de disco do Windows&lt;/h2&gt;&lt;p&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Clique com o &lt;b&gt;botão&lt;/b&gt; &lt;b&gt;direito &lt;/b&gt;do mouse no menu Iniciar e escolha o item &quot;Gerenciamento de Disco&quot;. Veja a imagem abaixo:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEj1cCxNeojGp34YD66MPHx-l8jVvjjCer4NafqnQSs_hhMfCA8yJdDi6XXLnsXpSUwp8uFAUjS3pahlAQ0FK203Qxz_ErOE_15XrGRz-FdQ0tI1Hjle4ye3ReQtZ5OzYSa4QXnl4hIC9brNF2J61xo_2Q1YIww1M0YU-Caio8n6bwetPPXK-lGp9a0HY8E&quot; style=&quot;font-size: x-large; margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;651&quot; data-original-width=&quot;410&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEj1cCxNeojGp34YD66MPHx-l8jVvjjCer4NafqnQSs_hhMfCA8yJdDi6XXLnsXpSUwp8uFAUjS3pahlAQ0FK203Qxz_ErOE_15XrGRz-FdQ0tI1Hjle4ye3ReQtZ5OzYSa4QXnl4hIC9brNF2J61xo_2Q1YIww1M0YU-Caio8n6bwetPPXK-lGp9a0HY8E=s16000&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;3º Passo - Verifique o espaço disponível no volume &quot;C:&quot;&lt;/h2&gt;&lt;p style=&quot;text-align: left;&quot;&gt;Será aberto o Gerenciamento de Disco do Windows, antes de fazermos o particionamento vamos verificar se há espaço livre no volume &quot;C:&quot;.&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;Veja na imagem abaixo, destacado em vermelho que o disco tem a capacidade total é de aproximadamente de 456 GB e estão livres (disponíveis) aproximadamente 317 GB, ou seja 70% do volume &quot;C:&quot;.&lt;/p&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiUQwQtVIJCjs54onn3BkMmGuaQqmo7pSlMOiuI_LtXWQOHTCPlQaQkA2l8DshzzAd89p-IZ_-XeEbzdB2B3wPlRbPNDFAeo0wKbLc6694tvoQ52XL0my7GH6LOiPhZT6hgRDNS5L311tmWyB4iCApAFeBnS_OYoke6vu7Aj2AflPqEGEvvrReI-D8WA3c&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;595&quot; data-original-width=&quot;559&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiUQwQtVIJCjs54onn3BkMmGuaQqmo7pSlMOiuI_LtXWQOHTCPlQaQkA2l8DshzzAd89p-IZ_-XeEbzdB2B3wPlRbPNDFAeo0wKbLc6694tvoQ52XL0my7GH6LOiPhZT6hgRDNS5L311tmWyB4iCApAFeBnS_OYoke6vu7Aj2AflPqEGEvvrReI-D8WA3c=s16000&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;4º Passo - Diminuir o tamanho volume &quot;C:&quot;&lt;/h2&gt;&lt;p style=&quot;text-align: left;&quot;&gt;Vamos reduzir (diminuir) o tamanho do &quot;C:&quot;.&lt;b&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #990000;&quot;&gt;A redução NÃO&amp;nbsp; deve utilizar o total do espaço livre do seu volume, neste exemplo o meu volume &quot;C:&quot; tem 317 GB.&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;Lembre-se que o volume &quot;C:&quot; armazena os aplicativos do Sistema Operacional Windows, além do perfil do usuário (Desktop, Documentos, Download, biblioteca padrão para arquivos de mídia, dados de aplicativo, etc).&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;Neste exemplo, vamos diminuir 40 GB.&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;Vamos clicar com o botão direito no volume &quot;C:&quot; escolher o item &quot;Diminuir Volume&quot; do menu.&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;Veja a imagem abaixo:&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgw_FwXNo7xUgHMys-3mmREGdHO-tqIN2vDj89zhAGZb-XO7EwN1DMQMjXWxWYbbAXtv0L2Vih84yy3VSAAG9Y3RzZpwyI0o_OzImNfyQedqP4qvCXHDmD1WJ9JsOusYQVWEo4UO5nBhW7wuo3oPYIH05AHy-eeYse9vv_xKtYu1Zh_f4X2II4HnG0JRG4&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;592&quot; data-original-width=&quot;526&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgw_FwXNo7xUgHMys-3mmREGdHO-tqIN2vDj89zhAGZb-XO7EwN1DMQMjXWxWYbbAXtv0L2Vih84yy3VSAAG9Y3RzZpwyI0o_OzImNfyQedqP4qvCXHDmD1WJ9JsOusYQVWEo4UO5nBhW7wuo3oPYIH05AHy-eeYse9vv_xKtYu1Zh_f4X2II4HnG0JRG4=s16000&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Será exibida a mensagem de alerta: &quot;Consultando Espaço de Diminuição&quot;, aguarde até aparecer uma nova janela com os valores disponíveis deste volume:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgLwfsY3TaUU0ZVvLPUlCKhKmR5jYxSH6vXsYPLUyOf2D7Y2img4Q1QnXnHTPa48UAi2WoDG5FSyisl8LiDw6h2u2rB21cl8-ZfCtRsrLgIwoihwwx6ta7fDC5SB67THdjRAEyyG1tpLzT4_BgUy4EVTu55IHMq7d0ycZ3RHu9IYTRARblGRFYkehN-6Uw&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;592&quot; data-original-width=&quot;501&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgLwfsY3TaUU0ZVvLPUlCKhKmR5jYxSH6vXsYPLUyOf2D7Y2img4Q1QnXnHTPa48UAi2WoDG5FSyisl8LiDw6h2u2rB21cl8-ZfCtRsrLgIwoihwwx6ta7fDC5SB67THdjRAEyyG1tpLzT4_BgUy4EVTu55IHMq7d0ycZ3RHu9IYTRARblGRFYkehN-6Uw=s16000&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Será aberta uma janela com um campo para a digitação da redução do volume.&amp;nbsp;&lt;/div&gt;&lt;div&gt;Veja a imagem abaixo:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiWlOyUhNJznfUTbKiLcbyajYymWX2XiwIB2uGWAfQg4NBeONDOY9LW8Tc_sOg3bDiFNWCk8_t21y0NJvy6EjSdz8Pw-t0_Htfz39vZxtVboQWEEUVSoePr8JjQyi6i4VfDdqsHaTIbZj2hjM53lQ-1MzbEZtWky9dqW2umy0jC6HAz3cSBhG3FIz5cdl0&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;584&quot; data-original-width=&quot;486&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiWlOyUhNJznfUTbKiLcbyajYymWX2XiwIB2uGWAfQg4NBeONDOY9LW8Tc_sOg3bDiFNWCk8_t21y0NJvy6EjSdz8Pw-t0_Htfz39vZxtVboQWEEUVSoePr8JjQyi6i4VfDdqsHaTIbZj2hjM53lQ-1MzbEZtWky9dqW2umy0jC6HAz3cSBhG3FIz5cdl0=s16000&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;Digite a quantidade que você vai diminuir do volume &quot;C:&quot;, no campo:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #666666;&quot;&gt;&amp;nbsp;Digite o espaço a diminuir em MB&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Neste exemplo vou diminuir 40 GB, logo tenho que converter para MB multiplicando o valor por 1024 MB, pois 1 GB tem 1024 MB.&lt;/p&gt;&lt;p style=&quot;text-align: center;&quot;&gt;40 *&amp;nbsp;&lt;span style=&quot;color: #741b47;&quot;&gt;1024&amp;nbsp;&lt;/span&gt;= 40960&lt;/p&gt;&lt;p&gt;Logo neste campo, vamos preencher com&amp;nbsp;&lt;span style=&quot;text-align: center;&quot;&gt;40960, em seguida clicar no botão &quot;Diminuir&quot;.&lt;/span&gt;&lt;/p&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/a/AVvXsEgDalIVBl8IiZVmqHScfspY8TgKq9Z-vo-QPumZWB-oPseZEo_DhG655J70sDy5HvyMGn8SHFoQFx3kCRMwCLE-HBeVbL4h3PgFK8tEb7BfNHzDuJrvRwim0opOjYSzQ4iSv15iewVl99ECCG6Ul6ta4PWd772tu80Figxul08UOdsgQoyaSpVfH1w4UFI&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;&quot; data-original-height=&quot;306&quot; data-original-width=&quot;447&quot; height=&quot;219&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgDalIVBl8IiZVmqHScfspY8TgKq9Z-vo-QPumZWB-oPseZEo_DhG655J70sDy5HvyMGn8SHFoQFx3kCRMwCLE-HBeVbL4h3PgFK8tEb7BfNHzDuJrvRwim0opOjYSzQ4iSv15iewVl99ECCG6Ul6ta4PWd772tu80Figxul08UOdsgQoyaSpVfH1w4UFI&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;5º Passo - Aguarde a operação de redução do volume &quot;C:&quot; ser finalizada.&lt;/h2&gt;&lt;div&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjjTs2Q_Gu1w-zD5Ku6dJ35u-KjiPysyeHBLW_JtBuEsfZGXN4e2wzhWM0gc1MINlx_nMJY39kZgxNWPPKsnvFgPQt2569vISUno5idmjecq-TknQVLrrsl78yafJKxrwg5I4XXRlCy983Bos0mty6zbsgG9v6asLYWEHldkTnvxt7KeRCbZn7VUf1Ke7o&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;642&quot; data-original-width=&quot;556&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjjTs2Q_Gu1w-zD5Ku6dJ35u-KjiPysyeHBLW_JtBuEsfZGXN4e2wzhWM0gc1MINlx_nMJY39kZgxNWPPKsnvFgPQt2569vISUno5idmjecq-TknQVLrrsl78yafJKxrwg5I4XXRlCy983Bos0mty6zbsgG9v6asLYWEHldkTnvxt7KeRCbZn7VUf1Ke7o=s16000&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;6ª Passo - Verifique o tamanho do volume &quot;C:&quot; após a operação ser finalizada.&lt;/h2&gt;&lt;span&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span&gt;Note que o tamanho do volume &quot;C:&quot; caiu de 456,36 para&amp;nbsp;&lt;/span&gt;416,36,&amp;nbsp; ou seja 40 GB.&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;Também foi criado um novo volume &quot;Não alocado&quot; (não utilizado).&amp;nbsp;&lt;/p&gt;&lt;div style=&quot;font-size: x-large;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgWYnDeZMLZtCQ9oH5wlpKN9F9q-HSWT7fQY0kUvWVeGzv9VdU1vZjlwV-mhR8_k6j3-WRtSDaFTXxBbGOTxNgMI7MzcWIZtBW_OfjO0Ys8ksqPpZ7Fva5Kvz2dIhQhhN-Noyj3Lhk90yTbPMu6E33F5oxJSBlDi4zcDMGRv-jpNjWb3J0095lVDAz9eZc&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;237&quot; data-original-width=&quot;523&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgWYnDeZMLZtCQ9oH5wlpKN9F9q-HSWT7fQY0kUvWVeGzv9VdU1vZjlwV-mhR8_k6j3-WRtSDaFTXxBbGOTxNgMI7MzcWIZtBW_OfjO0Ys8ksqPpZ7Fva5Kvz2dIhQhhN-Noyj3Lhk90yTbPMu6E33F5oxJSBlDi4zcDMGRv-jpNjWb3J0095lVDAz9eZc=s16000&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;7º Passo - Criar o volume &quot;D:&quot;&lt;/h2&gt;&lt;span&gt;&lt;span&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span&gt;Clique com o botão direito do mouse no volume &quot;Não alocado&quot; e clique no item &quot;Novo Volume Simples...&quot;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;font-size: x-large;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgeVWgUDTBNajvdBa6ntjLaDwRTtLViMNI6Fhm8bST0sjBtk0qcSKmBjMNb5tRmVovXL9FAKKJI16_3QLr1IRde-cYspy0VluWXT9wsry3hUmtHLwX0KGX5sLJ-Z_P4bbifAJLuIKJ1aMtBimu7G5e_I9prvPEJ3s9qdFC-HiSY8GdFJ4r9ZrTW0WbeqJw&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;&quot; data-original-height=&quot;280&quot; data-original-width=&quot;362&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgeVWgUDTBNajvdBa6ntjLaDwRTtLViMNI6Fhm8bST0sjBtk0qcSKmBjMNb5tRmVovXL9FAKKJI16_3QLr1IRde-cYspy0VluWXT9wsry3hUmtHLwX0KGX5sLJ-Z_P4bbifAJLuIKJ1aMtBimu7G5e_I9prvPEJ3s9qdFC-HiSY8GdFJ4r9ZrTW0WbeqJw&quot; width=&quot;310&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;b style=&quot;color: #20124d;&quot;&gt;Será aberto o assistente para &quot;Novas Partições Simples&quot;.&lt;/b&gt;&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;8º Passo - Configurar o novo volume utilizando o assistente de novas partições &lt;/h2&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span&gt;&lt;b&gt;a) &lt;/b&gt;Clique no botão &quot;Avançar&quot;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjgGzsONE0ZDSxB-MXTNC5rdHkOgO4oVx62m8i2PtMLM6q4ybKEnWdq5cwNL7zfmWo9ilRsb9jOxUckOmN_yj_sc-uE48jVx-kB5P0cEd7ol9e5g5awX6CEkawoXU_GqjNu1LUKozdriFbObKASPUovpEY9iV-zDrWKVVbJt_YP-uXU2YCppGAVvHiIPQo&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;556&quot; data-original-width=&quot;561&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjgGzsONE0ZDSxB-MXTNC5rdHkOgO4oVx62m8i2PtMLM6q4ybKEnWdq5cwNL7zfmWo9ilRsb9jOxUckOmN_yj_sc-uE48jVx-kB5P0cEd7ol9e5g5awX6CEkawoXU_GqjNu1LUKozdriFbObKASPUovpEY9iV-zDrWKVVbJt_YP-uXU2YCppGAVvHiIPQo=s16000&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;b&gt;b)&amp;nbsp;Escolha o tamanho do volume em MB&lt;/b&gt;: eu vou deixar o valor que já está preenchido no campo &quot;&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;Tamanho do Volume simples em MB&lt;/b&gt;&lt;/span&gt;&quot;, pois eu quero o tamanho seja de 40 GB, mas você pode escolher o valor que você preferir entre mínimo e o máximo indicado pelo assistente.&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;Em seguida clique no botão &quot;Avançar&quot;.&lt;/p&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEh5AmHYM-tMOBtlPWU5oCtu9tXGL0i5QAG-sYJQdpEqEzzE64u82iWQFOvPbSWVTLn69r79b2kzT5EoGRR55VlRfCrrtMcyyJ2GUuYFcxuBn9R5-XxkGXMp1mK3liVp5NRAqtoaDAqTmmggWXslbr2TD2RqozFbo3FJpHzDg-rIqR37Soh7Bga6_3PTkY8&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;480&quot; data-original-width=&quot;560&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEh5AmHYM-tMOBtlPWU5oCtu9tXGL0i5QAG-sYJQdpEqEzzE64u82iWQFOvPbSWVTLn69r79b2kzT5EoGRR55VlRfCrrtMcyyJ2GUuYFcxuBn9R5-XxkGXMp1mK3liVp5NRAqtoaDAqTmmggWXslbr2TD2RqozFbo3FJpHzDg-rIqR37Soh7Bga6_3PTkY8=s16000&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/span&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b&gt;c) Escolha a letra do novo volume:&lt;/b&gt;&amp;nbsp;no nosso volume vamos escolher a letra &quot;D:&quot;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiiT-5rzl9usMPBUO67sGRwbfOLdh6UwxacwZfsLbwK-L74Nly74CYpyfVDM4WWyVEBSeO2Pxfb8QZ7UO93BkZBkdMQXtkcxaAH43EuKz9DXIf7dfzCBBHVnkhncVFV1vi8W7L8Sz_rane5pX9cvHxnfIV7MA8Uh_IL2eQMglWwgq3qwMrUmtrCyF_NsSc&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;590&quot; data-original-width=&quot;554&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiiT-5rzl9usMPBUO67sGRwbfOLdh6UwxacwZfsLbwK-L74Nly74CYpyfVDM4WWyVEBSeO2Pxfb8QZ7UO93BkZBkdMQXtkcxaAH43EuKz9DXIf7dfzCBBHVnkhncVFV1vi8W7L8Sz_rane5pX9cvHxnfIV7MA8Uh_IL2eQMglWwgq3qwMrUmtrCyF_NsSc=s16000&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b&gt;d) &lt;/b&gt;Clique no botão avançar&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhd_0ivLtKJ5VsOBPhcDMgx2HjK4dVpZgdkLuNvdUM5GBArmM4MKK2A9fWJ2tp4AssfW_tLOLdiHEydI6yAv4ZtfFz2Weryc-kQubuzac6qojVEZWM4AXhbld6gRZaGp8mDf9fY-KsUI0YRsBwbvQ8J9oDODz_CKDzaGAgolNGkmKIpWOqsQQwY156kj8I&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;480&quot; data-original-width=&quot;532&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhd_0ivLtKJ5VsOBPhcDMgx2HjK4dVpZgdkLuNvdUM5GBArmM4MKK2A9fWJ2tp4AssfW_tLOLdiHEydI6yAv4ZtfFz2Weryc-kQubuzac6qojVEZWM4AXhbld6gRZaGp8mDf9fY-KsUI0YRsBwbvQ8J9oDODz_CKDzaGAgolNGkmKIpWOqsQQwY156kj8I=s16000&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/span&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b&gt;e)&amp;nbsp;Formatar o volume:&lt;/b&gt; você deve formatar o volume para que seja possível incluir arquivos nesta partição. Foi utilizado o formato padrão do Windows o NTFS.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;img alt=&quot;Fazendo upload: 184072 de 184072 bytes.&quot; border=&quot;0&quot; class=&quot;placeholder&quot; id=&quot;40d768d038aaa8&quot; src=&quot;https://www.blogger.com/img/transparent.gif&quot; style=&quot;background-color: #d8d8d8; background-image: url(&#39;https://fonts.gstatic.com/s/i/materialiconsextended/insert_photo/v6/grey600-24dp/1x/baseline_insert_photo_grey600_24dp.png&#39;); background-position: 50% 50%; background-repeat: no-repeat; opacity: 0.6;&quot; /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhYg9CHXmaRyyvYS8qNZNPI0Wb54wnQI9KA7qHmPE5cSGrPar__7BVTp3CrQh5ErRBATBl5grN3ZbL08Ki7wvXVgJQJnV5f9nPjWrV20HJbb2A3QpS3hTxga0wUtlez4Q5UKuOpyOJzLhyqGtTnEHiWmlA3nStCDMTXApu0xMuX6XWHgcCCle_BHAiaJBo&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;481&quot; data-original-width=&quot;525&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhYg9CHXmaRyyvYS8qNZNPI0Wb54wnQI9KA7qHmPE5cSGrPar__7BVTp3CrQh5ErRBATBl5grN3ZbL08Ki7wvXVgJQJnV5f9nPjWrV20HJbb2A3QpS3hTxga0wUtlez4Q5UKuOpyOJzLhyqGtTnEHiWmlA3nStCDMTXApu0xMuX6XWHgcCCle_BHAiaJBo=s16000&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/span&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b&gt;f)&amp;nbsp;Escolher o rótulo do volume:&lt;/b&gt;&amp;nbsp;o rótulo é o nome do volume, neste exemplo vou escolher &quot;Dados&quot;, mas você pode escolher o nome da sua preferência.&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Em seguida, clicar no botão &quot;Avançar&quot;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgGnpT8Uf5OoqRsJpGWsusK5CTtZa97-clp7tUjTiLHr3gtxrokitPAUDVpFACIuzcnw2J3NqZ2mmcXLR9lVv_pLkFRFrlVc-sg6QgeTM4yJCdot_J2ZteG3p-KRpXrFFs1uBoco_tt7g-7biYArLUdLEfWmJbf7SbaDjzZiCQWJoyDx7zDjYAHiKtOQvI&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;504&quot; data-original-width=&quot;569&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgGnpT8Uf5OoqRsJpGWsusK5CTtZa97-clp7tUjTiLHr3gtxrokitPAUDVpFACIuzcnw2J3NqZ2mmcXLR9lVv_pLkFRFrlVc-sg6QgeTM4yJCdot_J2ZteG3p-KRpXrFFs1uBoco_tt7g-7biYArLUdLEfWmJbf7SbaDjzZiCQWJoyDx7zDjYAHiKtOQvI=s16000&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/span&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b&gt;g) Verificar as configurações selecionadas&lt;/b&gt;: verifique se o novo volume que será criado está de acordo com a sua preferência, caso esteja, clique no botão &quot;Concluir&quot;, caso contrário clique no botão &quot;Voltar&quot;.&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEg14LoiYPu5xuubL_KcCAGSx4XCnWe37THhH4hCklCCUxVRuJhQX_Neej2mLe3XBKyrQs01zJ66FwoklgsE7me1aNhw6c24KAkUoLq4s8O8hrSgoFQcSITM6LXy6cNtivgOVZ5Hl7hzgc4NLjXQ3U3VTv8efzINYpPfeiIx_wMBWPjnCBsOnE9r7acEHtg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;519&quot; data-original-width=&quot;556&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEg14LoiYPu5xuubL_KcCAGSx4XCnWe37THhH4hCklCCUxVRuJhQX_Neej2mLe3XBKyrQs01zJ66FwoklgsE7me1aNhw6c24KAkUoLq4s8O8hrSgoFQcSITM6LXy6cNtivgOVZ5Hl7hzgc4NLjXQ3U3VTv8efzINYpPfeiIx_wMBWPjnCBsOnE9r7acEHtg=s16000&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/span&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;b&gt;h) &lt;/b&gt;Aguarde a criação do volume.&lt;/p&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhu29Wi8QSjouFawsnr2WC4pV-gppMH5zgiw-PIP5cyVj_Qj989-qTUdcY4ov2xKFNNL0AIB2_gi00Rz8hgRHnR_r46-fs8RYUkDqbw0PuYtY-_XVjZzEgNWG_9XJWJ-Sfh5_UdFDNwl-C25N5JX-Iok6zbZ6WgkZcfw2XYuJcnPh6hqEeYV8UHi0o9a50&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;586&quot; data-original-width=&quot;572&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhu29Wi8QSjouFawsnr2WC4pV-gppMH5zgiw-PIP5cyVj_Qj989-qTUdcY4ov2xKFNNL0AIB2_gi00Rz8hgRHnR_r46-fs8RYUkDqbw0PuYtY-_XVjZzEgNWG_9XJWJ-Sfh5_UdFDNwl-C25N5JX-Iok6zbZ6WgkZcfw2XYuJcnPh6hqEeYV8UHi0o9a50=s16000&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b&gt;i) &lt;/b&gt;Veja o resultado após a criação.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjgA4slLG65sA-QRdW70Wz77dXUmkKcE2IsgwyCSsIfaQbYTbWPJ0A9UF-G0aMWmBukiM6_jBR8yMbopZVyfU86_zlIzjNXthCn8mySzAQs1CSJFUZtuSR1Xh8WeG0xZrMGIWlf4GYqO-hFxOs8P09BgPO2lbRNes09ACwrFSXqM6p-CA8-nGrmIIQgric&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;100&quot; data-original-width=&quot;584&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjgA4slLG65sA-QRdW70Wz77dXUmkKcE2IsgwyCSsIfaQbYTbWPJ0A9UF-G0aMWmBukiM6_jBR8yMbopZVyfU86_zlIzjNXthCn8mySzAQs1CSJFUZtuSR1Xh8WeG0xZrMGIWlf4GYqO-hFxOs8P09BgPO2lbRNes09ACwrFSXqM6p-CA8-nGrmIIQgric=s16000&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;p style=&quot;text-align: left;&quot;&gt;Além da tela Gerenciamento, você também pode ver o resultado no Windows Explorer. Veja a imagem abaixo:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgNT6192XQdU1Y8DOTnuW7mo1CGd1DZ4162yVTn5zYosIW4rMNKgrWdIGcSjOtNjNfKf8-yxCSRVPX4gtcUI81jEJydMlPOdTAO7gYSJy0sLUtGZ5v4vlx7XVCfUVoE-TGFBlUdB0KDADHIC4GAAZNBwhOwjBMV1NVjYjGV2wmQlpm_kegWw7MBxsjXsnY&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;351&quot; data-original-width=&quot;539&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgNT6192XQdU1Y8DOTnuW7mo1CGd1DZ4162yVTn5zYosIW4rMNKgrWdIGcSjOtNjNfKf8-yxCSRVPX4gtcUI81jEJydMlPOdTAO7gYSJy0sLUtGZ5v4vlx7XVCfUVoE-TGFBlUdB0KDADHIC4GAAZNBwhOwjBMV1NVjYjGV2wmQlpm_kegWw7MBxsjXsnY=s16000&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://jquerydicas.blogspot.com/feeds/269464667939830328/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://jquerydicas.blogspot.com/2025/11/criar-uma-nova-particao-com-o.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/269464667939830328'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/269464667939830328'/><link rel='alternate' type='text/html' href='http://jquerydicas.blogspot.com/2025/11/criar-uma-nova-particao-com-o.html' title='Criar uma nova partição com o Gerenciador de Disco no Windows'/><author><name>Kelly</name><uri>http://www.blogger.com/profile/03449060135636479990</uri><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://img.youtube.com/vi/jH0cc_U1lRo/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7010404629734647455.post-1821149334818429666</id><published>2025-11-22T18:25:00.068-03:00</published><updated>2025-11-24T09:07:34.762-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Windows"/><title type='text'>Abrir o Gerenciador de Disco no Windows</title><content type='html'>&lt;p style=&quot;text-align: left;&quot;&gt;Resumidamente o Gerenciamento de Disco do Windows serve para:&lt;/p&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;Dividir o espaço&lt;/b&gt;: criar &quot;partições&quot; em um HD ou SSD. Por exemplo, ter uma partição C: para o Sistema Operacional (Windows, Linux, etc) e uma D: para arquivos pessoais.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Redimensionar: &lt;/b&gt;aumentar ou diminuir o tamanho de uma partição existente (caso haja espaço livre disponível).&lt;/li&gt;&lt;li&gt;&lt;b&gt;Formatar&lt;/b&gt;: apagar completamente uma unidade ou partição.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Mudar letras&lt;/b&gt;: alterar a letra designada para um drive. Exemplo: mudar de G: para H:.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Ativar discos novos&lt;/b&gt;: quando você instala um HD ou SSD novo, ele precisa ser &quot;inicializado&quot; por essa ferramenta para começar a funcionar.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Vamos mostrar quatro&lt;b&gt;&lt;span style=&quot;color: #073763;&quot;&gt;&amp;nbsp;formas&lt;/span&gt;&lt;/b&gt; para abrir o Gerenciamento de Disco no Windows.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Você pode escolher qualquer uma delas.&lt;/span&gt;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3&gt;&lt;span style=&quot;font-size: large;&quot;&gt;1ª Forma&lt;/span&gt;&lt;/h3&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Clique com o botão direito do mouse no menu Iniciar e escolha o item &quot;Gerenciamento de Disco&quot;. Veja a imagem abaixo ou assista o vídeo no &lt;a href=&quot;https://youtube.com/shorts/yD-ddDb4p7M?feature=share&quot; target=&quot;_blank&quot;&gt;YouTube&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEj1cCxNeojGp34YD66MPHx-l8jVvjjCer4NafqnQSs_hhMfCA8yJdDi6XXLnsXpSUwp8uFAUjS3pahlAQ0FK203Qxz_ErOE_15XrGRz-FdQ0tI1Hjle4ye3ReQtZ5OzYSa4QXnl4hIC9brNF2J61xo_2Q1YIww1M0YU-Caio8n6bwetPPXK-lGp9a0HY8E&quot; style=&quot;font-size: x-large; margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;651&quot; data-original-width=&quot;410&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEj1cCxNeojGp34YD66MPHx-l8jVvjjCer4NafqnQSs_hhMfCA8yJdDi6XXLnsXpSUwp8uFAUjS3pahlAQ0FK203Qxz_ErOE_15XrGRz-FdQ0tI1Hjle4ye3ReQtZ5OzYSa4QXnl4hIC9brNF2J61xo_2Q1YIww1M0YU-Caio8n6bwetPPXK-lGp9a0HY8E=s16000&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;iframe allowfullscreen=&quot;&quot; class=&quot;BLOG_video_class&quot; height=&quot;447&quot; src=&quot;https://www.youtube.com/embed/vq_h525knh8&quot; width=&quot;538&quot; youtube-src-id=&quot;vq_h525knh8&quot;&gt;&lt;/iframe&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;div&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;&lt;b&gt;2ª Forma&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;b&gt;a)&lt;/b&gt; Pressione as teclas Windows + R juntas para abrir a caixa de diálogo &quot;Executar&quot;.&lt;/p&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjzMKZWezVQmhLS1xXIDDbGcLzpl0-yztc3o57ZsGOC1FAmVeMgeVWRAkCTuO6jvF6I6Gmrv507Zjt7WfXGMYOtFCp-qyLrF4--TwFCB6pKCax1iz_-zjpgnfjGB3eWELVuHaf-FZzdU5yvvl86ymCr5QzCbnEHJJxVSYtgz02yToPqcBbVU1uEvL-W6Y0&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img alt=&quot;Windows + R&quot; data-original-height=&quot;252&quot; data-original-width=&quot;421&quot; height=&quot;192&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjzMKZWezVQmhLS1xXIDDbGcLzpl0-yztc3o57ZsGOC1FAmVeMgeVWRAkCTuO6jvF6I6Gmrv507Zjt7WfXGMYOtFCp-qyLrF4--TwFCB6pKCax1iz_-zjpgnfjGB3eWELVuHaf-FZzdU5yvvl86ymCr5QzCbnEHJJxVSYtgz02yToPqcBbVU1uEvL-W6Y0=w320-h192&quot; title=&quot;Windows + R&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;b&gt;b)&lt;/b&gt;&amp;nbsp;Será aberta a caixa de dialogo &quot;Executar&quot;, próxima a barra de tarefas (na parte inferior da tela).&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjry4apVWN9v0FGSZr3JAsVmid2ASkMA01A9kS7rnwToJKlDqzHvleKkDGld7yWhHvEf9Uq74yp2dCYfuCC0R-WaMvIVup4oDEVSFVmLjvttQkvSwvMni9i6wGfeW6JX4gQ5VJShXkON8iWvCLfmBJR7J8hNLklGgD7f_vCccOunUMSNmvsu0DWQWNMSXk&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img alt=&quot;Caixa de dialogo &amp;quot;Executar&amp;quot; do Windows&quot; data-original-height=&quot;281&quot; data-original-width=&quot;433&quot; height=&quot;208&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjry4apVWN9v0FGSZr3JAsVmid2ASkMA01A9kS7rnwToJKlDqzHvleKkDGld7yWhHvEf9Uq74yp2dCYfuCC0R-WaMvIVup4oDEVSFVmLjvttQkvSwvMni9i6wGfeW6JX4gQ5VJShXkON8iWvCLfmBJR7J8hNLklGgD7f_vCccOunUMSNmvsu0DWQWNMSXk=w320-h208&quot; title=&quot;Caixa de dialogo &amp;quot;Executar&amp;quot; do Windows&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;b&gt;c)&lt;/b&gt; Digite &lt;b&gt;&lt;span style=&quot;color: #073763;&quot;&gt;diskmgmt.msc&lt;/span&gt;&lt;/b&gt; no campo de texto &quot;Abrir&quot;. Veja a imagem abaixo:&lt;/p&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: left;&quot;&gt;&lt;img alt=&quot;diskmgmt.msc&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgnkJxcADglGK2gitjqWthzJe0DBSBLmmpPYrknFMI7F3x4EIxmQ7b7dVTEM3y1ZEIJ90t46Qrgk1TVTqeHPJMd6oH4eyb3zxdhQVhkJ4xxY1awElt3dVas_ZJXwAX1xwfthM062-AcGiRUEI79t38QgbcRSI4eAQz8Cr1r3kEKO_ULmZ1_60QMQGGlEqM=s16000&quot; title=&quot;diskmgmt.msc&quot; /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;b&gt;d)&lt;/b&gt; Clique no botão OK ou pressionar a tecla &quot;Enter&quot;.&lt;/p&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEi3G8kVXdFhoDipDGTqtbRXqBidjsdbENfKmxpp7RRLOV8RxtgYY74freFQFbY5mJogu22AV7iQ0wp2IMpJwjQkAP-nirkTshZzzTix0XtmMa9dN2ubJ6Tlg3MZP0emVdOhdCFYBPze0jRKo82xHBlIt8O_cMAEOuOrTg3RoAaipsW7BV_25FKWPrADIoA&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;/a&gt;&lt;div style=&quot;clear: left; display: inline; margin-bottom: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEi3G8kVXdFhoDipDGTqtbRXqBidjsdbENfKmxpp7RRLOV8RxtgYY74freFQFbY5mJogu22AV7iQ0wp2IMpJwjQkAP-nirkTshZzzTix0XtmMa9dN2ubJ6Tlg3MZP0emVdOhdCFYBPze0jRKo82xHBlIt8O_cMAEOuOrTg3RoAaipsW7BV_25FKWPrADIoA&quot; style=&quot;clear: left; display: inline; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEi3G8kVXdFhoDipDGTqtbRXqBidjsdbENfKmxpp7RRLOV8RxtgYY74freFQFbY5mJogu22AV7iQ0wp2IMpJwjQkAP-nirkTshZzzTix0XtmMa9dN2ubJ6Tlg3MZP0emVdOhdCFYBPze0jRKo82xHBlIt8O_cMAEOuOrTg3RoAaipsW7BV_25FKWPrADIoA&quot; style=&quot;clear: left; display: inline; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Confirmar comando da caixa de diálogo&quot; data-original-height=&quot;206&quot; data-original-width=&quot;393&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEi3G8kVXdFhoDipDGTqtbRXqBidjsdbENfKmxpp7RRLOV8RxtgYY74freFQFbY5mJogu22AV7iQ0wp2IMpJwjQkAP-nirkTshZzzTix0XtmMa9dN2ubJ6Tlg3MZP0emVdOhdCFYBPze0jRKo82xHBlIt8O_cMAEOuOrTg3RoAaipsW7BV_25FKWPrADIoA=s16000&quot; title=&quot;Confirmar comando da caixa de diálogo&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #38761d; font-size: large;&quot;&gt;OU&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhrIa4SEDlG2vZCpg_R4_pvZELS5KUzddCxvPKTSS9JkrmvrxJqxIeifnv2YHJR8V2hKDeeY-k863AuhygYidysoMTdflSJtaaDUOL-jns4zyGCeOTkz48XAXl9KbV1GDEqq1DCZFvTsPcqeOo_wmxMoohJ-1yykGnt9_AsR2S8qisJP_wkPqMEx2ib8Lw&quot; style=&quot;font-weight: bold; margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img alt=&quot;Tecla Enter&quot; data-original-height=&quot;153&quot; data-original-width=&quot;91&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhrIa4SEDlG2vZCpg_R4_pvZELS5KUzddCxvPKTSS9JkrmvrxJqxIeifnv2YHJR8V2hKDeeY-k863AuhygYidysoMTdflSJtaaDUOL-jns4zyGCeOTkz48XAXl9KbV1GDEqq1DCZFvTsPcqeOo_wmxMoohJ-1yykGnt9_AsR2S8qisJP_wkPqMEx2ib8Lw=w119-h200&quot; title=&quot;Tecla Enter&quot; width=&quot;119&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEi3G8kVXdFhoDipDGTqtbRXqBidjsdbENfKmxpp7RRLOV8RxtgYY74freFQFbY5mJogu22AV7iQ0wp2IMpJwjQkAP-nirkTshZzzTix0XtmMa9dN2ubJ6Tlg3MZP0emVdOhdCFYBPze0jRKo82xHBlIt8O_cMAEOuOrTg3RoAaipsW7BV_25FKWPrADIoA&quot; style=&quot;clear: left; display: inline; float: left; margin-bottom: 1em; margin-right: 1em; text-align: left;&quot;&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b&gt;e)&lt;/b&gt; Será aberta a janela de Gerenciamento de Disco.&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div&gt;&lt;img alt=&quot;Janela de Gerenciamento de Disco&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEh1BjY1H2t2g2x-oTTz-l6LGmsm_iGlF6UtZQjwSUnFrQhlD3RoyTG1eZUQQomYb3J4l04LXGqjqe1BHTgp7CY5-JxRVMSzBTzSPuaupsBgiTBsOTGR1Plc4hrpHHVDraDhJ51zE7HDhqKG7H1tk64eZn2uNUSYYU5yGycQvkkLIORFk8rgqtnaFDmj0tY=s16000&quot; title=&quot;Janela de Gerenciamento de Disco&quot; /&gt;&lt;div&gt;&lt;/div&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;3ª Forma&lt;/span&gt;&lt;/h3&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;b&gt;a)&lt;/b&gt; Pressione as teclas&amp;nbsp; Windows + X juntas para abrir o menu de acesso rápido.&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEg1cXisHidbG7LlY1Iu0AXc_nghYVEWEY6MtbLCdOqnMqcH8k5MxLXQpGJBg1TdlpSdWikcQS2t6qSN-Nc9-76PLEe40_fZxhDv1NrETI-zzSg7g5NPpl_cVBWWkqr6sTPp_4sqkA1uLyA-pY3eixpZjd9vwNanFkSVCqTu9Xp8-hbGtMWyKaFBUqix9tE&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Windows + X&quot; data-original-height=&quot;252&quot; data-original-width=&quot;322&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEg1cXisHidbG7LlY1Iu0AXc_nghYVEWEY6MtbLCdOqnMqcH8k5MxLXQpGJBg1TdlpSdWikcQS2t6qSN-Nc9-76PLEe40_fZxhDv1NrETI-zzSg7g5NPpl_cVBWWkqr6sTPp_4sqkA1uLyA-pY3eixpZjd9vwNanFkSVCqTu9Xp8-hbGtMWyKaFBUqix9tE&quot; title=&quot;Windows + X&quot; width=&quot;307&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;p&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;b&gt;b)&lt;/b&gt; Será aberto um menu vertical. Clique em &quot;Gerenciamento de Disco&quot;, Conforme a imagem abaixo:&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjO_giJ2jbmGTd9iElJcwOyvLcQi3bdV3CjI_2FK44B9xeCEPQAoVr0seAe6CCJN-riCkyO6ZIeiXIEzmSJr0F4FHoH6BEu5A61su8kEbqd9J5pyR06esuJ-Zf2RcjeyG5oTHJ8lhI9qe2jukAnpEGILjKFPeZUQklYtAGFButyQCG6gnFLUEFEO55JFHY&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Menu de acesso rápido do Window&quot; data-original-height=&quot;590&quot; data-original-width=&quot;224&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjO_giJ2jbmGTd9iElJcwOyvLcQi3bdV3CjI_2FK44B9xeCEPQAoVr0seAe6CCJN-riCkyO6ZIeiXIEzmSJr0F4FHoH6BEu5A61su8kEbqd9J5pyR06esuJ-Zf2RcjeyG5oTHJ8lhI9qe2jukAnpEGILjKFPeZUQklYtAGFButyQCG6gnFLUEFEO55JFHY=s16000&quot; title=&quot;Menu de acesso rápido do Window&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;h3&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;c)&lt;/span&gt;&lt;span style=&quot;font-size: small; font-weight: normal;&quot;&gt; Veja a janela de Gerenciamento de Disco&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;img alt=&quot;Janela de Gerenciamento de Disco&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEg06ecSn76HTCxmNaSIA15nhICZgFFP7nIXu8jcr14c6EVxEkLeGvA0K0wcuIHDq5NTvm7NO4hnf722GZJDl8xaCNYPDl3LJ6b6Lf-c6tQha9bMTuACcWqKMulfskGYJi1BEPCcKdYXiiWevdCu52cJAVV4W9VwPdxSsXzvXxmbVfHXcngolwOLaIav4lA=s16000&quot; title=&quot;Janela de Gerenciamento de Disco&quot; /&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;4ª Forma&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/h3&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;b&gt;a)&lt;/b&gt; No campo Pesquisar da Barra de Tarefas do Windows, na parte inferior da tela digite &quot;Criar e formatar partições do disco rígido&quot; ou &quot;Gerenciamento de Disco&quot;&amp;nbsp;&lt;/p&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/a/AVvXsEhnS7XnkNhKkmos9KiceYEW_MDUIh68gTzOhXEd-I_QIqIlYL38pSggP9B1JXsKzQ4FMIg8K2Xg-BSYp4pDYjmutTA5y-UWTeryz3_WGdEvbB-VPM-w-gQG4EZR9dXjIrNgZ2EdMnv9uT8wW22BzfcS8yAWdPR5mKaW5a-Pw6yf5KgJHrmDLDgbDnQu6CA&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img alt=&quot;Campo pesquisar na Barra de Tarefas do Windows&quot; data-original-height=&quot;48&quot; data-original-width=&quot;558&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhnS7XnkNhKkmos9KiceYEW_MDUIh68gTzOhXEd-I_QIqIlYL38pSggP9B1JXsKzQ4FMIg8K2Xg-BSYp4pDYjmutTA5y-UWTeryz3_WGdEvbB-VPM-w-gQG4EZR9dXjIrNgZ2EdMnv9uT8wW22BzfcS8yAWdPR5mKaW5a-Pw6yf5KgJHrmDLDgbDnQu6CA=s16000&quot; title=&quot;Campo pesquisar na Barra de Tarefas do Windows&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;b&gt;b)&lt;/b&gt; Clique na opção exibida no menu&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjQUQQyVK0FjDy7EJLIrvJrYFRPT6CsuCP9bERd2gdeLVYQ_Ux-Ps_SsDglw17VAFvgpZYU1I79fYgfn0erXkcGN9pH8G2WGTov_mHY9HvJY7s-2zcJyH7Gsxs6ziS86f0Fr4r73P3giI9quW3_JqY9u2JewuUttabLMuO1ExjavqsZmDGSkd_t1M3iXOY&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Resultado da Pesquisa&quot; data-original-height=&quot;494&quot; data-original-width=&quot;333&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjQUQQyVK0FjDy7EJLIrvJrYFRPT6CsuCP9bERd2gdeLVYQ_Ux-Ps_SsDglw17VAFvgpZYU1I79fYgfn0erXkcGN9pH8G2WGTov_mHY9HvJY7s-2zcJyH7Gsxs6ziS86f0Fr4r73P3giI9quW3_JqY9u2JewuUttabLMuO1ExjavqsZmDGSkd_t1M3iXOY=s16000&quot; title=&quot;Resultado da Pesquisa&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;/p&gt;&lt;span style=&quot;text-align: left;&quot;&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;b&gt;c)&lt;/b&gt; Veja a janela de&amp;nbsp;&amp;nbsp;Gerenciamento de Disco&lt;/p&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;img alt=&quot;Janela de Gerenciamento de Disco&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEj8ei5JPyOnYuzdosVw5kZXowue8g0kNqbGQg565MDYgjreBgSQVIUGK8lm5a4OJ0L9AXhZSLzzN_a6S1z9H827uK_ILGvWaKlHuYNXMPmHpcuZsbJK6L3eLQ9bdMkxDtYfzLzH_DjP1d70TayV4Fvfx8Bf6biWXYsdlc8hyuCpw6UOOY5i5oTq9v4ekqo=s16000&quot; title=&quot;Janela de Gerenciamento de Disco&quot; /&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;b style=&quot;color: #073763;&quot;&gt;Sua opinião é muito importante, criticas ou sugestões serão bem-vindas.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jquerydicas.blogspot.com/feeds/1821149334818429666/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://jquerydicas.blogspot.com/2025/11/abrir-o-gerenciador-de-disco-no-windows.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/1821149334818429666'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/1821149334818429666'/><link rel='alternate' type='text/html' href='http://jquerydicas.blogspot.com/2025/11/abrir-o-gerenciador-de-disco-no-windows.html' title='Abrir o Gerenciador de Disco no Windows'/><author><name>Kelly</name><uri>http://www.blogger.com/profile/03449060135636479990</uri><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/a/AVvXsEj1cCxNeojGp34YD66MPHx-l8jVvjjCer4NafqnQSs_hhMfCA8yJdDi6XXLnsXpSUwp8uFAUjS3pahlAQ0FK203Qxz_ErOE_15XrGRz-FdQ0tI1Hjle4ye3ReQtZ5OzYSa4QXnl4hIC9brNF2J61xo_2Q1YIww1M0YU-Caio8n6bwetPPXK-lGp9a0HY8E=s72-c" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7010404629734647455.post-6522460560836617479</id><published>2025-11-20T16:27:00.141-03:00</published><updated>2025-11-21T14:13:20.420-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="funções de manipulação de string"/><category scheme="http://www.blogger.com/atom/ns#" term="postgresql"/><title type='text'>Postgresql - Função split_part</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span face=&quot;Arial, Helvetica, sans-serif&quot; style=&quot;color: #990000;&quot;&gt;&lt;p style=&quot;color: black; text-align: left;&quot;&gt;&amp;nbsp;A função&amp;nbsp;split_part divide uma string em duas ou mais partes (pedaços) e retorna um determinado pedaço de acordo com a posição escohida.&amp;nbsp;&lt;/p&gt;&lt;div style=&quot;color: black; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;color: black; text-align: justify;&quot;&gt;&lt;b style=&quot;font-family: Arial, Helvetica, sans-serif; text-align: start;&quot;&gt;SINTAXE&lt;/b&gt;&lt;br /&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span face=&quot;Arial, Helvetica, sans-serif&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span face=&quot;Arial, Helvetica, sans-serif&quot; style=&quot;font-size: medium;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;b&gt;split_part(string&lt;/b&gt;&lt;/span&gt;&lt;span&gt;&lt;b&gt;,&lt;/b&gt;&lt;span style=&quot;color: #a64d79;&quot;&gt;&amp;nbsp;&lt;b&gt;&#39;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #990000;&quot;&gt;delimitador&#39;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #674ea7; font-weight: bold;&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;posição&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;b&gt;)&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span face=&quot;Arial, Helvetica, sans-serif&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span face=&quot;Arial, Helvetica, sans-serif&quot;&gt;Onde:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;span face=&quot;Arial, Helvetica, sans-serif&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #990000;&quot;&gt;delimitador&lt;/span&gt;&lt;/b&gt;: um caractere ou um conjunto de caracteres que indica onde a string será quebrada em pedaços. Este delimitador deve ser usado entre aspas simples;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span face=&quot;Arial, Helvetica, sans-serif&quot;&gt;&lt;span style=&quot;color: #674ea7;&quot;&gt;&lt;b&gt;posição&lt;/b&gt;&lt;/span&gt;:&amp;nbsp;qual o pedaço da string será retornado pela função. Preencha com 1 para o 1º pedaço, 2&lt;/span&gt;&amp;nbsp;para o 2º pedaço, 3&amp;nbsp;para o 3º pedaço, e assim por diante&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-weight: 400;&quot;&gt;Veja os dois exemplos abaixo, caso tenha interesse&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-weight: 400;&quot;&gt;veja&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-weight: 400;&quot;&gt;os scripts&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-weight: 400;&quot;&gt;&amp;nbsp;no&lt;/span&gt;&lt;span style=&quot;font-weight: 400;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;https://github.com/kellysc2013/dicas_sql_jquery/blob/master/Postgresql%20-%20Fun%C3%A7%C3%A3o%20split_part/split_part.sql&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;GitHub&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-weight: 400;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-weight: 400;&quot;&gt;ou&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-weight: 400;&quot;&gt;faça o&lt;/span&gt;&lt;span style=&quot;font-weight: 400;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;download no&amp;nbsp;&lt;a href=&quot;https://drive.google.com/drive/u/0/folders/1Bh03FpanFvZeX394haFjIj2bW86glL0r&quot; target=&quot;_blank&quot;&gt;&lt;b&gt;Google Drive&lt;/b&gt;&lt;/a&gt;&lt;b&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-weight: 400;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;h3&gt;&lt;b&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;1º Exemplo&lt;/span&gt;&lt;/b&gt;&lt;/h3&gt;&lt;span face=&quot;Arial, Helvetica, sans-serif&quot;&gt;Em uma coluna chamada &quot;e_mail&quot;&amp;nbsp;de uma tabela&amp;nbsp;&lt;/span&gt;&quot;clientes&quot;,&lt;span face=&quot;Arial, Helvetica, sans-serif&quot;&gt;&amp;nbsp;temos os dados de e-mails dos clientes. Vamos separar o usuário do e-mail do domínio do e-mail, vejamos alguns casos na prática:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span face=&quot;Arial, Helvetica, sans-serif&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span face=&quot;Arial, Helvetica, sans-serif&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhNmWgzxoVhPgsPa7jORBr7rfL-8E9xPo9TRDw--CJ3YZhlsI_tqbjT-QR-VR48waIzEfSkHbf_Pvg6QCG4vfnAJCZyYKiFnf8aJitpJFO5mOM0ecClhami2Ck2j2rVVNE4kuvUdKI473mOCthMMOAs_f3FLp5SjR8sSt4SJDNLUf2l0bi8Dq1n-ciYqZs&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;157&quot; data-original-width=&quot;528&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhNmWgzxoVhPgsPa7jORBr7rfL-8E9xPo9TRDw--CJ3YZhlsI_tqbjT-QR-VR48waIzEfSkHbf_Pvg6QCG4vfnAJCZyYKiFnf8aJitpJFO5mOM0ecClhami2Ck2j2rVVNE4kuvUdKI473mOCthMMOAs_f3FLp5SjR8sSt4SJDNLUf2l0bi8Dq1n-ciYqZs=s16000&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;span face=&quot;Arial, Helvetica, sans-serif&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;Aqui explico o conceito de usuário e domínio de um e-mail, caso você já conheça, pule esta explicação e veja a execução do comando sql logo abaixo.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li style=&quot;text-align: left;&quot;&gt;&lt;b&gt;no e-mail maria@gmail.com&lt;/b&gt;: o usuário (é o que vem antes do &quot;@&quot; neste caso maria), já o domínio (é o que vem depois do &quot;@&quot; neste caso &quot;gmail.com&quot;);&lt;/li&gt;&lt;li style=&quot;text-align: left;&quot;&gt;&lt;b&gt;no e-mail joao123@outlook.com&lt;/b&gt;: o usuário (é o que vem antes do &quot;@&quot; neste caso joao123) já o&amp;nbsp;domínio (é&amp;nbsp;o que vem depois do &quot;@&quot; neste caso &quot;outlook.com&quot;);&lt;/li&gt;&lt;li style=&quot;text-align: left;&quot;&gt;&lt;b&gt;no e-mail carolina.alves@empresax.com.br:&lt;/b&gt;&amp;nbsp;o usuário (é o que vem antes do &quot;@&quot; neste caso carolina.alves) já o&amp;nbsp;domínio (é&amp;nbsp;o que vem depois do &quot;@&quot; neste caso &quot;empresax.com.br&quot;);&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span face=&quot;Arial, Helvetica, sans-serif&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span face=&quot;Arial, Helvetica, sans-serif&quot;&gt;Neste caso, o &quot;@&quot; será utilizado para fazer a quebra do e-mail em usuário e domínio, logo o&amp;nbsp;&lt;/span&gt;&quot;@&quot; será o delimitador.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Veja abaixo a query (comando sql) para fazer a quebra da string:&lt;/div&gt;&lt;div&gt;&lt;span face=&quot;Arial, Helvetica, sans-serif&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span face=&quot;Arial, Helvetica, sans-serif&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;SELECT&lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span face=&quot;Arial, Helvetica, sans-serif&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;e_mail,&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span face=&quot;Arial, Helvetica, sans-serif&quot;&gt;&lt;span style=&quot;color: #0b5394; text-align: left;&quot;&gt;&lt;b&gt;split_part(e_mail&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;text-align: left;&quot;&gt;&lt;b&gt;,&lt;/b&gt;&lt;span style=&quot;color: #a64d79;&quot;&gt;&amp;nbsp;&#39;&lt;/span&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;@&#39;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #674ea7; font-weight: bold; text-align: left;&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #351c75; text-align: left;&quot;&gt;&lt;b&gt;1&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #0b5394; text-align: left;&quot;&gt;&lt;b&gt;),&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span face=&quot;Arial, Helvetica, sans-serif&quot;&gt;&lt;span style=&quot;color: #0b5394; text-align: left;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;b&gt;split_part(&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;b style=&quot;color: #0b5394;&quot;&gt;e_mail&lt;/b&gt;&lt;b&gt;,&lt;/b&gt;&lt;span style=&quot;color: #a64d79;&quot;&gt;&amp;nbsp;&#39;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #990000;&quot;&gt;@&#39;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #674ea7; font-weight: bold;&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;2&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;b&gt;)&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span face=&quot;Arial, Helvetica, sans-serif&quot;&gt;&lt;span style=&quot;color: #274e13; font-weight: bold;&quot;&gt;FROM&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;&lt;b&gt;clientes&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;b style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;span face=&quot;Arial, Helvetica, sans-serif&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span face=&quot;Arial, Helvetica, sans-serif&quot;&gt;Após a execução da query, temos o resultado exibido na imagem abaixo:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&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/a/AVvXsEiuuQRXR2bp2Yh-pRMQ5fUH3x4OtJEGNFI7QGOZHyODWxiLoqaRjU9CjTu91z9POrdhJzaEnRNkY249AjKKjvbCdU1Eh38_XbYSBtOqP3tyzEcRZ87uZTM3hvJe5UNyhX7rTFqeuVKOA0ESTjJTgwX2BsZ2UMVN9Rcj61SvBED0eVTepM1n01pISibWHco&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em; text-align: left;&quot;&gt;&lt;img alt=&quot;Retorno da função split_part&quot; data-original-height=&quot;156&quot; data-original-width=&quot;592&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiuuQRXR2bp2Yh-pRMQ5fUH3x4OtJEGNFI7QGOZHyODWxiLoqaRjU9CjTu91z9POrdhJzaEnRNkY249AjKKjvbCdU1Eh38_XbYSBtOqP3tyzEcRZ87uZTM3hvJe5UNyhX7rTFqeuVKOA0ESTjJTgwX2BsZ2UMVN9Rcj61SvBED0eVTepM1n01pISibWHco=s16000&quot; title=&quot;Retorno da função split_part&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;clear: both; text-align: left;&quot;&gt;&lt;b style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;span style=&quot;color: black; font-weight: 400;&quot;&gt;Perceba que após a execução do comando acima, a coluna chamada &quot;split_part&quot; armazena o usuário do e-mail e a coluna chamada &quot;split_part_2&quot; armazena o domínio do e-mail. Podemos dar alias (apelidos) para os nomes das colunas para facilitar o entendimento utilizando o comando &quot;AS&quot;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;b style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;b style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;SELECT&lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span face=&quot;Arial, Helvetica, sans-serif&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;e_mail,&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span face=&quot;Arial, Helvetica, sans-serif&quot;&gt;&lt;span style=&quot;color: #0b5394; text-align: left;&quot;&gt;&lt;b&gt;split_part(e_mail&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;text-align: left;&quot;&gt;&lt;b&gt;,&lt;/b&gt;&lt;span style=&quot;color: #a64d79;&quot;&gt;&amp;nbsp;&#39;&lt;/span&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;@&#39;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #674ea7; font-weight: bold; text-align: left;&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #351c75; text-align: left;&quot;&gt;&lt;b&gt;1&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #0b5394; text-align: left;&quot;&gt;&lt;b&gt;)&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;b style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #ffa400;&quot;&gt;AS&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;color: #741b47;&quot;&gt;usuario&lt;/span&gt;&lt;/b&gt;&lt;b style=&quot;color: #0b5394; text-align: left;&quot;&gt;,&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span face=&quot;Arial, Helvetica, sans-serif&quot;&gt;&lt;span style=&quot;color: #0b5394; text-align: left;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;b&gt;split_part(&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;b style=&quot;color: #0b5394;&quot;&gt;e_mail&lt;/b&gt;&lt;b&gt;,&lt;/b&gt;&lt;span style=&quot;color: #a64d79;&quot;&gt;&amp;nbsp;&#39;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #990000;&quot;&gt;@&#39;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #674ea7; font-weight: bold;&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;2&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;b&gt;)&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #ffa400;&quot;&gt;AS&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;b&gt;dominio&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span face=&quot;Arial, Helvetica, sans-serif&quot;&gt;&lt;span style=&quot;color: #274e13; font-weight: bold;&quot;&gt;FROM&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;&lt;b&gt;clientes&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;b style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Após a execução da query, temos o resultado exibido na imagem abaixo:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #38761d; font-size: medium;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;; font-weight: 400; text-align: left;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span face=&quot;Arial, Helvetica, sans-serif&quot; style=&quot;color: #38761d; font-weight: 700;&quot;&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/a/AVvXsEiIPFZG7-2VjBDnZ_u2l4HDGUdGRZFVR8hZhKyl8FGp0CwrhpKwAtGMawEbx0nwvrybWZ67AQMoKf1QBfaninMXijUCD0Wg876jNLYbPlz4gByyvTu9MqJ_zHC4xvGFZImFIlquYliBkSQdwelFYDmZerGG43Ey7SD5s87GLU4_bFwNGFFZKmUxPKzDqxw&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Resultado da coluna com alias para melhor identificação&quot; data-original-height=&quot;161&quot; data-original-width=&quot;601&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiIPFZG7-2VjBDnZ_u2l4HDGUdGRZFVR8hZhKyl8FGp0CwrhpKwAtGMawEbx0nwvrybWZ67AQMoKf1QBfaninMXijUCD0Wg876jNLYbPlz4gByyvTu9MqJ_zHC4xvGFZImFIlquYliBkSQdwelFYDmZerGG43Ey7SD5s87GLU4_bFwNGFFZKmUxPKzDqxw=s16000&quot; title=&quot;Resultado da coluna com alias para melhor identificação&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;b style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;Antes de usar &quot;SPLIT_PART&quot;, verifique&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;se o delimitador existe na string&lt;/b&gt;: para evitar resultados inesperados. Neste exemplo foi o &quot;@&quot;.&lt;/li&gt;&lt;li&gt;&lt;b&gt;se o delimitador está bem posicionado:&lt;/b&gt;&amp;nbsp;no caso deste exemplo, em específico, verificar se o &quot;@&quot; não está no início ou no fim do e-mail&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Se o delimitador NÃO for encontrado ou estiver mal posicionado, algum pedaço de string será vazia.&lt;br /&gt;&lt;br /&gt;No exemplo anterior, consideramos que todos os e-mails, tem o &quot;@&quot; que é o delimitador e que ele está bem posicionado.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;No segundo exemplo, vamos simular o uso do &quot;split_part&quot; com e-mails sem &quot;@&quot; ou mal posicionado.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;h3&gt;&lt;b&gt;2º Exemplo&lt;/b&gt;&lt;/h3&gt;&lt;div&gt;&lt;span&gt;Vamos executar a mesma query do e-mail anterior mas com e-mails inválidos.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&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/a/AVvXsEh82sdNStEm7HmPTml5JvrfKlf_4viDDi0bUkgHqA1wPzX8Ziq6zxDdiHwohROTfQhDkBi1kykhHCrQwpcrKqDffMtr3aIPZ2R4XyKjhkjaypeW7ljVewA4D3wbTf6QRE8aMB-E5kj-hTj3EveOjM16yVS4gvcjCR35T40LOlS3J1yolC2tkegGAYhnX2s&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Uso do split_part com dados inválidos&quot; data-original-height=&quot;201&quot; data-original-width=&quot;343&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEh82sdNStEm7HmPTml5JvrfKlf_4viDDi0bUkgHqA1wPzX8Ziq6zxDdiHwohROTfQhDkBi1kykhHCrQwpcrKqDffMtr3aIPZ2R4XyKjhkjaypeW7ljVewA4D3wbTf6QRE8aMB-E5kj-hTj3EveOjM16yVS4gvcjCR35T40LOlS3J1yolC2tkegGAYhnX2s=s16000&quot; title=&quot;Uso do split_part com dados inválidos&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;b style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;SELECT&lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span face=&quot;Arial, Helvetica, sans-serif&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;e_mail,&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span face=&quot;Arial, Helvetica, sans-serif&quot;&gt;&lt;span style=&quot;color: #0b5394; text-align: left;&quot;&gt;&lt;b&gt;split_part(e_mail&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;text-align: left;&quot;&gt;&lt;b&gt;,&lt;/b&gt;&lt;span style=&quot;color: #a64d79;&quot;&gt;&amp;nbsp;&#39;&lt;/span&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;@&#39;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #674ea7; font-weight: bold; text-align: left;&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #351c75; text-align: left;&quot;&gt;&lt;b&gt;1&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #0b5394; text-align: left;&quot;&gt;&lt;b&gt;)&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;b style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #ffa400;&quot;&gt;AS&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;color: #741b47;&quot;&gt;usuario&lt;/span&gt;&lt;/b&gt;&lt;b style=&quot;color: #0b5394; text-align: left;&quot;&gt;,&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span face=&quot;Arial, Helvetica, sans-serif&quot;&gt;&lt;span style=&quot;color: #0b5394; text-align: left;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;b&gt;split_part(&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;b style=&quot;color: #0b5394;&quot;&gt;e_mail&lt;/b&gt;&lt;b&gt;,&lt;/b&gt;&lt;span style=&quot;color: #a64d79;&quot;&gt;&amp;nbsp;&#39;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #990000;&quot;&gt;@&#39;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #674ea7; font-weight: bold;&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;2&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;b&gt;)&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #ffa400;&quot;&gt;AS&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;b&gt;dominio&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span face=&quot;Arial, Helvetica, sans-serif&quot;&gt;&lt;span style=&quot;color: #274e13; font-weight: bold;&quot;&gt;FROM&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;&lt;b&gt;clientes&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;b style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Após a execução da query, temos o resultado exibido na imagem abaixo:&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiCo3xDHAwGI11RiiF4cc4iU-dTVfjgh0bih9OSdX_4cxdpQOiV0gkYwve0VWeJLMKW7VGeFrZVuNgBzUgpHobW_madzlQG94VouYELCuD4IogS9LZ2ipnhoXgN62ROP10VgeUdJSEAV1apUbmIKGcuGkKbdLRTdEUjvJUuUAtO315isqrt5eAkgTwjR4k&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;split_part com string sem delimitador ou com delimitador mal posicionado&quot; data-original-height=&quot;200&quot; data-original-width=&quot;584&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiCo3xDHAwGI11RiiF4cc4iU-dTVfjgh0bih9OSdX_4cxdpQOiV0gkYwve0VWeJLMKW7VGeFrZVuNgBzUgpHobW_madzlQG94VouYELCuD4IogS9LZ2ipnhoXgN62ROP10VgeUdJSEAV1apUbmIKGcuGkKbdLRTdEUjvJUuUAtO315isqrt5eAkgTwjR4k=s16000&quot; title=&quot;split_part com string sem delimitador ou com delimitador mal posicionado&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;Percebemos que houve retorno de string vazia tanto na coluna usuário quanto na coluna domínio.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;Logo, antes de utilizarmos está função, é importante verificarmos se os dados são validos.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;h3&gt;&lt;span style=&quot;color: #990000; font-family: inherit;&quot;&gt;Observação&lt;/span&gt;&lt;/h3&gt;&lt;div&gt;O uso de SPLIT_PART não é adequado para colunas com grandes volumes de texto devido a possíveis problemas com desempenho.&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span face=&quot;Arial, Helvetica, sans-serif&quot; style=&quot;color: #990000;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span face=&quot;Arial, Helvetica, sans-serif&quot; style=&quot;color: #073763;&quot;&gt;&lt;b&gt;Sua opinião é muito importante, criticas ou sugestões serão bem-vindas.&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jquerydicas.blogspot.com/feeds/6522460560836617479/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://jquerydicas.blogspot.com/2025/11/postgresql-funcao-splitpart.html#comment-form' title='1 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/6522460560836617479'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/6522460560836617479'/><link rel='alternate' type='text/html' href='http://jquerydicas.blogspot.com/2025/11/postgresql-funcao-splitpart.html' title='Postgresql - Função split_part'/><author><name>Kelly</name><uri>http://www.blogger.com/profile/03449060135636479990</uri><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/a/AVvXsEhNmWgzxoVhPgsPa7jORBr7rfL-8E9xPo9TRDw--CJ3YZhlsI_tqbjT-QR-VR48waIzEfSkHbf_Pvg6QCG4vfnAJCZyYKiFnf8aJitpJFO5mOM0ecClhami2Ck2j2rVVNE4kuvUdKI473mOCthMMOAs_f3FLp5SjR8sSt4SJDNLUf2l0bi8Dq1n-ciYqZs=s72-c" height="72" width="72"/><thr:total>1</thr:total><georss:featurename>Londrina, PR, Brasil</georss:featurename><georss:point>-23.3197305 -51.1662008</georss:point><georss:box>-31.157034973297833 -59.9552633 -15.482426026702166 -42.3771383</georss:box></entry><entry><id>tag:blogger.com,1999:blog-7010404629734647455.post-7481029572968512953</id><published>2020-11-02T04:43:00.003-03:00</published><updated>2025-11-23T06:48:13.064-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="PowerShell"/><category scheme="http://www.blogger.com/atom/ns#" term="tnc"/><category scheme="http://www.blogger.com/atom/ns#" term="verificar porta aberta no Windows"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows"/><title type='text'>Verificar se uma porta está aberta no Windows (pingar ip com porta) - PowerShell</title><content type='html'>&lt;div&gt;&lt;p&gt;Para verificar se uma porta está aberta no Window PowerShell, vamos utilizar o comando &quot;tnc&quot;.&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;b&gt; &lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;b&gt;1º Passo)&lt;/b&gt; Abrir o Windows PowerShell. &lt;i&gt;Caso já saiba como abrir o “Windows PowerShell” vá para o “2º Passo”.&lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;Será apresentado 2 formas para abrir o PowerShell.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;a) 1ª Forma -&lt;/b&gt; pressione a tecla do Windows (do seu teclado) junto com a tecla R.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&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/AVvXsEg7v7lWUnpYYtkEgDpAG1NzyBntDs-KPaDFKR38YP4wkF9HD5hWDykOwb8IUqb0vOiqZvtFsIDMubQHaD-sJtNSvaDkhY8wYMPGftMgSfVzFTdOfmME0wD5cSjwwcn_l_iyB4sHxtYGM50/s97/tecla_windows_mais_r_executar_comando_20201101_1519.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;47&quot; data-original-width=&quot;97&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7v7lWUnpYYtkEgDpAG1NzyBntDs-KPaDFKR38YP4wkF9HD5hWDykOwb8IUqb0vOiqZvtFsIDMubQHaD-sJtNSvaDkhY8wYMPGftMgSfVzFTdOfmME0wD5cSjwwcn_l_iyB4sHxtYGM50/s0/tecla_windows_mais_r_executar_comando_20201101_1519.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;Será exibida a janela abaixo, digite powershell e clique no botão “ok”.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;/p&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/AVvXsEiyrpv_SYo7DdDW6zdEYY6oMg3v1YoAz-S_8OHf2G6gdKrAzyD5c8a2JmdAcstt9LyGR172dBdl9HYSpUaGw1REqTZ1hIpBDGG8EvqCONuMU4Bb6E2FyT90yiF6b1Nu2WeSR_agDAqKPEM/s399/abrir_windows_powershell_janela_executar_20201101_1528.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;210&quot; data-original-width=&quot;399&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyrpv_SYo7DdDW6zdEYY6oMg3v1YoAz-S_8OHf2G6gdKrAzyD5c8a2JmdAcstt9LyGR172dBdl9HYSpUaGw1REqTZ1hIpBDGG8EvqCONuMU4Bb6E2FyT90yiF6b1Nu2WeSR_agDAqKPEM/s16000/abrir_windows_powershell_janela_executar_20201101_1528.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&amp;nbsp;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Será exibido o Windows PowerShell.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;/p&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/AVvXsEi4fGSptVFcBcw0LGPYhE5UfzABKXfDjB_3PkMLo3Fj82vy9ThaMY1fvqr53A9wE5dpiH1botbn-zkMh4fRKs_xHfldvd4h-vxGs4ag6C1u1D13PmgGH6VP7XfmX42Z0sg6Z98MlFDqewk/s501/windows_powershell_20201101_1535.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;276&quot; data-original-width=&quot;501&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4fGSptVFcBcw0LGPYhE5UfzABKXfDjB_3PkMLo3Fj82vy9ThaMY1fvqr53A9wE5dpiH1botbn-zkMh4fRKs_xHfldvd4h-vxGs4ag6C1u1D13PmgGH6VP7XfmX42Z0sg6Z98MlFDqewk/s16000/windows_powershell_20201101_1535.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;b) 2ª Forma -&lt;/b&gt; Abra o menu iniciar e escolha a opção &quot;Windows PowerShell&quot;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&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/AVvXsEi8R7mlllf5Gq39FdKzPRAH0_stok_6AWUw5P2mOe571Y_K_8o4sJUHZDTnSfZB_TdpX5q2tCsyKG56KW5Ohp21BjSGnSebG10KmmHQvYr04K42khrEttlSrxJCkUMkiS1tBMhMTR6Tf3Y/s557/menu_iniciar_windows_powershell_20201101_1549.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;507&quot; data-original-width=&quot;557&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8R7mlllf5Gq39FdKzPRAH0_stok_6AWUw5P2mOe571Y_K_8o4sJUHZDTnSfZB_TdpX5q2tCsyKG56KW5Ohp21BjSGnSebG10KmmHQvYr04K42khrEttlSrxJCkUMkiS1tBMhMTR6Tf3Y/s16000/menu_iniciar_windows_powershell_20201101_1549.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;p&gt;Será exibido o Windows PowerShell.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&amp;nbsp;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4fGSptVFcBcw0LGPYhE5UfzABKXfDjB_3PkMLo3Fj82vy9ThaMY1fvqr53A9wE5dpiH1botbn-zkMh4fRKs_xHfldvd4h-vxGs4ag6C1u1D13PmgGH6VP7XfmX42Z0sg6Z98MlFDqewk/s501/windows_powershell_20201101_1535.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;276&quot; data-original-width=&quot;501&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4fGSptVFcBcw0LGPYhE5UfzABKXfDjB_3PkMLo3Fj82vy9ThaMY1fvqr53A9wE5dpiH1botbn-zkMh4fRKs_xHfldvd4h-vxGs4ag6C1u1D13PmgGH6VP7XfmX42Z0sg6Z98MlFDqewk/s16000/windows_powershell_20201101_1535.png&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &lt;br /&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;b&gt;2º Passo)&lt;/b&gt; Executar os comandos abaixo conforme sua necessidade.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Segue 4 exemplos:&lt;br /&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;O 1º exemplo verifica se a porta está aberta utilizando o domínio e a porta;&lt;/li&gt;&lt;li&gt;O 2º exemplo verifica se a porta está aberta utilizando o IP (IPV6) e a porta;&lt;/li&gt;&lt;li&gt;O 3º exemplo verifica se a porta está aberta utilizando o IP (IPV4) e a porta;&lt;/li&gt;&lt;li&gt;O 4º exemplo exibe o retorno do comando quando a porta está fechada.&lt;/li&gt;&lt;/ul&gt;&amp;nbsp;&lt;p&gt;&lt;b&gt;a)&lt;/b&gt; Verificar se a porta 80 do domínio “google.com.br” está aberta.&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;tnc&lt;/b&gt;&lt;/span&gt; &lt;span style=&quot;color: #351c75;&quot;&gt;dominio&lt;/span&gt; &lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;-port&lt;/b&gt;&lt;/span&gt; &lt;span style=&quot;color: #351c75;&quot;&gt;numero_da_porta&lt;/span&gt;&lt;/p&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/AVvXsEgFtZBND_YtQWMJymvfc81ZAnXkjplYUkKwqGsGEnKMT3w-VTA678rEmF2Qm5COX2ygPupAV69K8f-Zd6SugNtp8rCdIekmPC67qGlalpa-zNW9XSXQ6xFCfZLc5XgmDqlMJHDimGWtl-s/s531/powershell_tnc_dominio_porta_20201101_1047.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;176&quot; data-original-width=&quot;531&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFtZBND_YtQWMJymvfc81ZAnXkjplYUkKwqGsGEnKMT3w-VTA678rEmF2Qm5COX2ygPupAV69K8f-Zd6SugNtp8rCdIekmPC67qGlalpa-zNW9XSXQ6xFCfZLc5XgmDqlMJHDimGWtl-s/s16000/powershell_tnc_dominio_porta_20201101_1047.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p style=&quot;text-align: left;&quot;&gt;Verifique se o valor de TcpTestSucceeded. Se o valor for “True” (verdadeiro) a porta está aberta mas se o valor for “False” (falso) a porta está fechada.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;b&gt;b)&lt;/b&gt; Verificar se a porta 80 do “google.com” está aberta, utilizando o IP do mesmo.&lt;/p&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;tnc&lt;/span&gt;&lt;/b&gt;&amp;nbsp; &lt;span style=&quot;color: #351c75;&quot;&gt;IP&lt;/span&gt; &lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;-port&lt;/b&gt;&lt;/span&gt; &lt;span style=&quot;color: #351c75;&quot;&gt;numero_da_porta&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-align: center;&quot;&gt;IP = 2800:3f0:4001:80b::200e &lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: center;&quot;&gt;Observação: o IP está no formato IPV6 (formato novo).&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;/span&gt;&lt;/p&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/AVvXsEj18t9rmY_O2kkmtQu0N9j0dE-QJuAYRPwwHWE872mvy0blkcJlo6jA0Hqm34p07JTg9lY_Bk3AB5oPozugzYzrWZhkC9PpLZf7nbhQmhEFxgfSxiiSgKJfWMNAhyphenhyphenLA14Qjat8UdtiT0AU/s530/powershell_tnc_ipv6_porta_20201101_1047.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;178&quot; data-original-width=&quot;530&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj18t9rmY_O2kkmtQu0N9j0dE-QJuAYRPwwHWE872mvy0blkcJlo6jA0Hqm34p07JTg9lY_Bk3AB5oPozugzYzrWZhkC9PpLZf7nbhQmhEFxgfSxiiSgKJfWMNAhyphenhyphenLA14Qjat8UdtiT0AU/s16000/powershell_tnc_ipv6_porta_20201101_1047.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;Verifique se o valor de TcpTestSucceeded. Se o valor for “True” 
(verdadeiro) a porta está aberta mas se o valor for “False” (falso) a 
porta está fechada.&lt;br /&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;b&gt;c)&lt;/b&gt; Verificar se a porta 80 está aberta. IP 104.197.20.162&amp;nbsp; &lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;tnc&lt;/span&gt;&lt;/b&gt; &lt;span style=&quot;color: #351c75;&quot;&gt;IP&lt;/span&gt; &lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;-port&lt;/b&gt;&lt;/span&gt; &lt;span style=&quot;color: #351c75;&quot;&gt;numero_da_porta&lt;/span&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&amp;nbsp;&lt;/span&gt;Observação: o IP está no formato IPV4 (formato antigo).&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;/span&gt;&lt;/p&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/AVvXsEjdMyfrbQzsyFw-LQOFrWi1cX0FgTbpZJM08Gmcv90TuTDluA5ewQobrutta5pejSWwc4BWrviPA5IcXRPOehKs20RrjO-KovQ7cDNfHKIwDT9T68C5YNF1KEDE_NoG61DEHL79ggPCPk4/s596/powershell_tnc_ipv4_porta_20201101_1047.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;196&quot; data-original-width=&quot;596&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdMyfrbQzsyFw-LQOFrWi1cX0FgTbpZJM08Gmcv90TuTDluA5ewQobrutta5pejSWwc4BWrviPA5IcXRPOehKs20RrjO-KovQ7cDNfHKIwDT9T68C5YNF1KEDE_NoG61DEHL79ggPCPk4/s16000/powershell_tnc_ipv4_porta_20201101_1047.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&amp;nbsp;&lt;p&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;Verifique se o valor de TcpTestSucceeded. Se o valor for “True” 
(verdadeiro) a porta está aberta mas se o valor for “False” (falso) a 
porta está fechada.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;d)&lt;/b&gt; Verificar se a porta 21 está aberta. IP 104.197.20.162.&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;tnc&lt;/span&gt;&lt;/b&gt; &lt;span style=&quot;color: #351c75;&quot;&gt;IP&lt;/span&gt; &lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;-port&lt;/b&gt;&lt;/span&gt; &lt;span style=&quot;color: #351c75;&quot;&gt;numero_da_porta&lt;/span&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;/span&gt;&lt;/p&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/AVvXsEgDXj6lFYdvdVwZRcF7Lp-KYbshcE20DWGg32Gv1MmxgbpYH0IJXLF4yph_hVpZ2hsvEePzD-eCgeht5T54A6GTTfRYNWO5MSpHqvuioWuJGCzj6okbhn_wBKWFcoKt5PAvAcq0yS8FK9M/s492/powershell_tnc_ip_porta_21_erro_20201101_1047.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;290&quot; data-original-width=&quot;492&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDXj6lFYdvdVwZRcF7Lp-KYbshcE20DWGg32Gv1MmxgbpYH0IJXLF4yph_hVpZ2hsvEePzD-eCgeht5T54A6GTTfRYNWO5MSpHqvuioWuJGCzj6okbhn_wBKWFcoKt5PAvAcq0yS8FK9M/s16000/powershell_tnc_ip_porta_21_erro_20201101_1047.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;Observe que abaixo do comando é exibido um aviso alertando que a conexão tcp falhou.&lt;br /&gt;Apesar de o servidor ter pingado (PingSucceeded: True), a porta está fechada. Veja o valor de TcpTestSucceeded igual a false.&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;b&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Referência:&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;ltr&quot; id=&quot;docs-internal-guid-7b05ec40-7fff-f084-88d3-ec6c3643fc02&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=7niN8ELj5B8&amp;amp;feature=emb_logo&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;-webkit-text-decoration-skip: none; background-color: transparent; color: #1155cc; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration-skip-ink: none; text-decoration: underline; vertical-align: baseline; white-space: pre;&quot;&gt;https://www.youtube.com/watch?v=7niN8ELj5B8&amp;amp;feature=emb_logo&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;a href=&quot;https://kb.parallels.com/en/124644&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;-webkit-text-decoration-skip: none; background-color: transparent; color: #1155cc; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration-skip-ink: none; text-decoration: underline; vertical-align: baseline; white-space: pre;&quot;&gt;https://kb.parallels.com/en/124644&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jquerydicas.blogspot.com/feeds/7481029572968512953/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://jquerydicas.blogspot.com/2020/11/verificar-se-uma-porta-esta-aberta-no.html#comment-form' title='1 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/7481029572968512953'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/7481029572968512953'/><link rel='alternate' type='text/html' href='http://jquerydicas.blogspot.com/2020/11/verificar-se-uma-porta-esta-aberta-no.html' title='Verificar se uma porta está aberta no Windows (pingar ip com porta) - PowerShell'/><author><name>Kelly</name><uri>http://www.blogger.com/profile/03449060135636479990</uri><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/AVvXsEg7v7lWUnpYYtkEgDpAG1NzyBntDs-KPaDFKR38YP4wkF9HD5hWDykOwb8IUqb0vOiqZvtFsIDMubQHaD-sJtNSvaDkhY8wYMPGftMgSfVzFTdOfmME0wD5cSjwwcn_l_iyB4sHxtYGM50/s72-c/tecla_windows_mais_r_executar_comando_20201101_1519.png" height="72" width="72"/><thr:total>1</thr:total><georss:featurename>São Paulo, Brasil</georss:featurename><georss:point>-23.5431786 -46.6291845</georss:point><georss:box>-55.868041246156196 -81.785434500000008 8.7816840461561974 -11.472934500000001</georss:box></entry><entry><id>tag:blogger.com,1999:blog-7010404629734647455.post-221483548940546830</id><published>2018-01-05T12:00:00.002-02:00</published><updated>2018-10-06T18:18:50.514-03:00</updated><title type='text'>Postgresql - Exportar dados de uma tabela para um arquivo csv ou txt com o comando psql \copy</title><content type='html'>&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;Através do comando &lt;span style=&quot;color: #0c343d;&quot;&gt;&lt;b&gt;psql&lt;/b&gt;&lt;/span&gt;&lt;b&gt; &lt;/b&gt;&lt;span style=&quot;background-color: white; color: #073763; white-space: normal;&quot;&gt;&lt;b&gt;\copy&lt;/b&gt;&lt;/span&gt; é possível exportar dados de uma tabela para um arquivo.&lt;/span&gt; &lt;/span&gt;&lt;span style=&quot;font-family: inherit; white-space: pre-wrap;&quot;&gt;O arquivo pode ser criado&lt;/span&gt;&lt;span style=&quot;font-family: inherit; white-space: pre-wrap;&quot;&gt; tanto no &lt;/span&gt;&lt;b style=&quot;font-family: inherit; white-space: pre-wrap;&quot;&gt;servidor&lt;/b&gt;&lt;span style=&quot;font-family: inherit; white-space: pre-wrap;&quot;&gt; quanto em uma máquina &lt;/span&gt;&lt;b style=&quot;font-family: inherit; white-space: pre-wrap;&quot;&gt;cliente&lt;/b&gt;&lt;span style=&quot;font-family: inherit; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit; white-space: pre-wrap;&quot;&gt;Neste exemplo, vamos executar os comandos do cliente psql através do prompt de comando do Windows. &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit; white-space: pre-wrap;&quot;&gt;Em breve, será postado como executar os comandos no terminal linux.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;Não confunda com o&lt;span style=&quot;color: red; font-weight: bold;&quot;&gt; comando sql &lt;/span&gt;&lt;b style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;copy&lt;/span&gt;&lt;/b&gt;, onde o arquivo deve estar &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;obrigatoriamente&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt; no servidor. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;background-color: white; line-height: 1.38; margin-bottom: 11pt; margin-top: 11pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;Para saber mais sobre o &lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;comando sql copy&lt;/span&gt;&lt;/b&gt; acesse o link: &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href=&quot;http://jquerydicas.blogspot.com.br/2013/10/postgre-exportar-arquivo-csv-e-txt.html&quot; style=&quot;font-family: inherit;&quot; target=&quot;_blank&quot;&gt;PostgreSql - exportar arquivo csv e txt&lt;/a&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;background-color: white; line-height: 1.38; margin-bottom: 11pt; margin-top: 11pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: large;&quot;&gt;&lt;b&gt;1º) Exemplo&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: transparent; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Vamos exportar os dados da tabela &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;&quot;estoque&quot;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt;, contida no &lt;/span&gt;&lt;span style=&quot;font-family: inherit; white-space: pre-wrap;&quot;&gt;banco de dados &quot;db_rem&quot;, localizado no&lt;/span&gt;&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt; &lt;b&gt;servidor&lt;/b&gt; &quot;104.197.20.162&quot; &lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; white-space: pre-wrap;&quot;&gt;para o arquivo &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&quot;estoque&lt;/span&gt;&lt;span style=&quot;background-color: transparent; white-space: pre-wrap;&quot;&gt;.csv&quot;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: transparent; white-space: pre-wrap;&quot;&gt;no&lt;/span&gt;&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt; diretório &quot;C:\temp&quot; da &lt;b&gt;máquina cliente&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: transparent; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;Caso tenha interesse, faça o &lt;/span&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;download&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt; deste exemplo no &lt;a href=&quot;https://drive.google.com/open?id=1s0KZS-_Egi6aNOtuvVCY3NbwHKktgOMv&quot; target=&quot;_blank&quot;&gt;Google Drive&lt;/a&gt; ou veja no &lt;/span&gt;&lt;a href=&quot;https://github.com/kellysc2013/dicas_sql_jquery/tree/master/artigo_copy_to/exemplo_1&quot; style=&quot;background-color: transparent; font-family: inherit;&quot; target=&quot;_blank&quot;&gt;GitHub&lt;/a&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: left; margin-right: 1em;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHdjbBEK2W5T8GE4TQU1hfSH5O8Nb9-ReDPvZ8D5MtvF_6mi_JF6vmCcxE0lVesU2eAzJSP2k5gjg0Id9L1ZV7RM3cvZk3ZI3-hkmFPU935d6qzNmpcovDh2OYJ-7xi9jzP2gWnUNJdVM/s1600/6+-+copy_tabela_estoque_registros.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;70&quot; data-original-width=&quot;587&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHdjbBEK2W5T8GE4TQU1hfSH5O8Nb9-ReDPvZ8D5MtvF_6mi_JF6vmCcxE0lVesU2eAzJSP2k5gjg0Id9L1ZV7RM3cvZk3ZI3-hkmFPU935d6qzNmpcovDh2OYJ-7xi9jzP2gWnUNJdVM/s1600/6+-+copy_tabela_estoque_registros.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;font-size: 12.8px; text-align: center;&quot;&gt;Dados da tabela estoque que serão exportados.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;

&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgK5KHpmzlPUneKtINo0zLbZF9cA1S33KgXQ7xghtgAuvRjuZ8dKS8Vm-10KHn95vfFSNJfvyfO4pVin-7BB4IbavbFESZ3_x-vXBUm3A20ZFyYlm4PtISMj93mWs2TjIWFYaA7chIzc5o/s1600/4+-+copy_localizacao_script_tabela_estoque.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;496&quot; data-original-width=&quot;515&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgK5KHpmzlPUneKtINo0zLbZF9cA1S33KgXQ7xghtgAuvRjuZ8dKS8Vm-10KHn95vfFSNJfvyfO4pVin-7BB4IbavbFESZ3_x-vXBUm3A20ZFyYlm4PtISMj93mWs2TjIWFYaA7chIzc5o/s1600/4+-+copy_localizacao_script_tabela_estoque.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;font-size: 12.8px;&quot;&gt;Localização e script da tabela &quot;estoque&quot;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIgiH1Hjx-RTaErtNkqEceQiwtWw3AZP3wLUHI1MaVv06T0Mi5E6QmtZylaponV1nHNexTQ-6ewaf0XTUgiWicjVeqCB14sIWg5rUuzclJMHi47VnA896OJIAJGXRjpx96-RaU8mP7fkU/s1600/arquivo_estoque_diretorio.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;277&quot; data-original-width=&quot;568&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIgiH1Hjx-RTaErtNkqEceQiwtWw3AZP3wLUHI1MaVv06T0Mi5E6QmtZylaponV1nHNexTQ-6ewaf0XTUgiWicjVeqCB14sIWg5rUuzclJMHi47VnA896OJIAJGXRjpx96-RaU8mP7fkU/s1600/arquivo_estoque_diretorio.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Diretório C:\temp&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt;&lt;/span&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 style=&quot;text-align: left;&quot;&gt;
Para a exportação siga as etapas abaixo:&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&lt;/span&gt;&lt;b&gt;a)&lt;/b&gt; Abra o prompt de comando.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpf0HY9z20qyEuJvW0jujNTqUU0W4oLS9lLamjYUQ9okHAASPfmPld4V7gTNLfVAFiiIXM8G_DWTcnxAmaXOh5XlJCx4DriLhq-e5ZBvFyVlydJ7wkkTAPhJ9ZyGZ_IPx7YLMbI0JDX-w/s1600/7+-+Abrir+prompt+de+comando+no+windows.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;121&quot; data-original-width=&quot;473&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpf0HY9z20qyEuJvW0jujNTqUU0W4oLS9lLamjYUQ9okHAASPfmPld4V7gTNLfVAFiiIXM8G_DWTcnxAmaXOh5XlJCx4DriLhq-e5ZBvFyVlydJ7wkkTAPhJ9ZyGZ_IPx7YLMbI0JDX-w/s1600/7+-+Abrir+prompt+de+comando+no+windows.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Prompt de Comando&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt;&lt;b&gt;b)&lt;/b&gt; Faça a autenticação no servidor.&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: transparent; font-family: inherit; font-size: 15.3333px; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhahZsPsLNZ6BrXAWjDiydC4iFD_JijBxOf-hS7xSh9B7ieKf80IxtJtlh0r6dSNigfQGanxXZA1lqxJ-IJoM0Mc3gSsUWr0u9jNBPrXu9MLM3dJLIbJvBMwpTv7z0KT6UNRARiENcTlFM/s1600/1+-+copy_autenticacao.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;57&quot; data-original-width=&quot;387&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhahZsPsLNZ6BrXAWjDiydC4iFD_JijBxOf-hS7xSh9B7ieKf80IxtJtlh0r6dSNigfQGanxXZA1lqxJ-IJoM0Mc3gSsUWr0u9jNBPrXu9MLM3dJLIbJvBMwpTv7z0KT6UNRARiENcTlFM/s1600/1+-+copy_autenticacao.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Autenticação&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt;Segue o comando: &lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt;psql&lt;/b&gt;&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #274e13; font-family: inherit; white-space: pre-wrap;&quot;&gt;&lt;b&gt;-h 104.197.20.162&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #073763; font-family: inherit; white-space: pre-wrap;&quot;&gt;&lt;b&gt;-d db_rem&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #741b47; font-family: inherit; white-space: pre-wrap;&quot;&gt;&lt;b&gt;-U postgres&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt;Legenda:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt;&lt;b style=&quot;color: #274e13;&quot;&gt;-h&lt;/b&gt;: ip ou nome do servidor;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt;&lt;b style=&quot;color: #073763;&quot;&gt;-d&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;: nome do banco de dados;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;color: #741b47; white-space: pre-wrap;&quot;&gt;-U&lt;/b&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;: nome do usuário;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b&gt;c)&lt;/b&gt; Será solicitada a senha, repare que ao digitar a senha não serão exibidos os caracteres. Digite a senha e pressione &quot;Enter&quot;.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;&lt;b&gt;d)&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt; Agora utilize o comando \copy para exportar os dados para o arquivo estoque.csv:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;color: #073763; white-space: normal;&quot;&gt;&lt;b&gt;\COPY&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #444444; white-space: normal;&quot;&gt;&lt;b&gt;(&amp;nbsp;&lt;/b&gt;&lt;b style=&quot;color: #351c75;&quot;&gt;SELECT&lt;/b&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #351c75; white-space: normal;&quot;&gt;&lt;b&gt;codigo&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;,&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #351c75; white-space: normal;&quot;&gt;&lt;b&gt;produto&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #351c75; white-space: normal;&quot;&gt;&lt;b&gt;categoria&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;,&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;marca&lt;/span&gt;&lt;span style=&quot;color: #444444;&quot;&gt;,&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #351c75; white-space: normal;&quot;&gt;&lt;b&gt;preco&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;,&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #351c75; white-space: normal;&quot;&gt;&lt;b&gt;quantidade FROM estoque&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #444444; white-space: normal;&quot;&gt;&lt;b&gt;)&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #134f5c; white-space: normal;&quot;&gt;&lt;b&gt;&amp;nbsp;to &#39;C:/temp/estoque.csv&#39; &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; font-family: inherit;&quot;&gt;&lt;span style=&quot;color: #783f04;&quot;&gt;&lt;b&gt;&amp;nbsp;WITH DELIMITER AS &#39;;&#39;&lt;/b&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; font-family: inherit;&quot;&gt;&lt;b&gt;CSV HEADER&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: transparent; font-family: inherit;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg05uctJY40C4vzR-PWELbIDNuEYJ-32ruaA_NjUZ_fvlHza3iUBQolNPG9cRlwa0BdwfJviYAa2w1vGDFXwVwH0pNc-KbKKUwOiqA1_5reoZPGLeaJI_AvVCEKF2I-DCnh1FXLHClmRRg/s1600/1+-+psql_copy_to_exportacao_de_dados_para_arquivo.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;75&quot; data-original-width=&quot;571&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg05uctJY40C4vzR-PWELbIDNuEYJ-32ruaA_NjUZ_fvlHza3iUBQolNPG9cRlwa0BdwfJviYAa2w1vGDFXwVwH0pNc-KbKKUwOiqA1_5reoZPGLeaJI_AvVCEKF2I-DCnh1FXLHClmRRg/s1600/1+-+psql_copy_to_exportacao_de_dados_para_arquivo.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Comando \copy&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Legenda:&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 11pt; margin-top: 11pt;&quot;&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b style=&quot;background-color: white; color: #073763;&quot;&gt;\COPY&lt;/b&gt;: comando psql;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white; color: #444444;&quot;&gt;&lt;b&gt;(&lt;/b&gt;&lt;b style=&quot;color: #351c75;&quot;&gt;SELECT&lt;/b&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #351c75;&quot;&gt;&lt;b&gt;codigo&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;,&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background-color: white; color: #351c75;&quot;&gt;&lt;b&gt;produto&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background-color: white; color: #351c75;&quot;&gt;&lt;b&gt;categoria&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;,&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;marca&lt;/span&gt;&lt;span style=&quot;color: #444444;&quot;&gt;,&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #351c75;&quot;&gt;&lt;b&gt;preco&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;,&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #351c75;&quot;&gt;&lt;b&gt;quantidade FROM estoque&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #444444;&quot;&gt;&lt;b&gt;)&lt;/b&gt;&lt;/span&gt;: dentro do parenteses colocamos uma query (consulta da tabela estoque). Neste exemplo, foram exportadas todas as colunas da tabela estoque mas isto não é obrigatório, podemos colocar na query algumas colunas ou retornar apenas alguns registros utilizando WHERE na query;&lt;/li&gt;
&lt;li&gt;&lt;b style=&quot;background-color: white; color: #134f5c;&quot;&gt;to &#39;C:/temp/estoque.csv&#39;&lt;/b&gt;:&lt;b style=&quot;color: #274e13;&quot;&gt;&amp;nbsp;&lt;/b&gt;após o &quot;to&quot; deverá ser colocado o nome do diretório, seguido pelo nome do arquivo e a extensão. Neste exemplo, a extensão é &quot;&lt;b style=&quot;color: #134f5c;&quot;&gt;.csv&lt;/b&gt;&quot; mas poderia ser &quot;&lt;span style=&quot;color: #0c343d;&quot;&gt;&lt;b&gt;.txt&lt;/b&gt;&lt;/span&gt;&quot;.&amp;nbsp;&lt;span style=&quot;color: #660000;&quot;&gt;Importante!!! Até mesmo no sistema operacional Windows, repare que &lt;b&gt;NÃO &lt;/b&gt;se deve utilizar a barra invertida &quot;&lt;b&gt;\&lt;/b&gt;&quot;, e sim a barra normal &lt;b&gt;&quot;&lt;/b&gt;&lt;span style=&quot;color: #134f5c;&quot;&gt;&lt;b&gt;/&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&quot;&lt;/b&gt; para identificar o diretório&lt;/span&gt;;&lt;/li&gt;
&lt;li&gt;&lt;b style=&quot;background-color: white; color: #783f04;&quot;&gt;WITH DELIMITER AS &#39;;&#39;&lt;/b&gt;: o delimitador serve para separar as colunas do arquivo. Após o &quot;&lt;b style=&quot;background-color: white; color: #783f04;&quot;&gt;WITH DELIMITER AS&lt;/b&gt;&quot;, coloque o delimitador. Neste exemplo, escolhemos o &quot;&lt;b style=&quot;color: #783f04;&quot;&gt;;&lt;/b&gt;&quot; mas o delimitador pode ser &quot;&lt;b&gt;|&lt;/b&gt;&quot; ou &quot;&lt;b&gt;,&lt;/b&gt;&quot; entre outros;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;CSV HEADER&lt;/b&gt;: este parâmetro indica que o nome das colunas serão exportados como cabeçalho na primeira linha do arquivo;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
Após executar o comando foi gerado um arquivo com cabeçalho e 3 registros.&lt;br /&gt;
&lt;span style=&quot;font-family: inherit; white-space: pre-wrap;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLToo1avXkPhsxymgkP5HsA4G8VdpxvAyw3Mp0Er8KnTTv3jgIQv4ORxV4wHlHmHbL22T7cesK_foBlcQUZv_96AezAufecp9XFHmQb16rePfCxW6Faa38V_gq2hTg08bgeXTMUtTlSGc/s1600/5+-+copy_arquivo_estoque.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;186&quot; data-original-width=&quot;541&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLToo1avXkPhsxymgkP5HsA4G8VdpxvAyw3Mp0Er8KnTTv3jgIQv4ORxV4wHlHmHbL22T7cesK_foBlcQUZv_96AezAufecp9XFHmQb16rePfCxW6Faa38V_gq2hTg08bgeXTMUtTlSGc/s1600/5+-+copy_arquivo_estoque.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;font-size: 12.8px;&quot;&gt;Arquivo: estoque.csv&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
&lt;br /&gt;
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;2º) Exemplo&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Neste exemplo, vamos exportar os dados da tabela &quot;estoque&quot; para o arquivo &lt;/span&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &quot;estoque_sc&lt;/span&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;.csv&quot;.&lt;/span&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;  &lt;b&gt;Porém&lt;/b&gt; &lt;b&gt;NÃO vamos exportar o cabeçalho&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;. &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;O procedimento é o mesmo do anterior com exceção do comando &lt;b style=&quot;color: #073763; white-space: normal;&quot;&gt;\copy&lt;/b&gt; &lt;span style=&quot;color: #660000;&quot;&gt;&lt;b&gt;que NÃO será utilizado o parâmetro&lt;/b&gt;&lt;/span&gt; &lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;b&gt;CSV HEADER&lt;/b&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt;Caso tenha interesse, faça o &lt;/span&gt;download&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt; deste exemplo no &lt;a href=&quot;https://drive.google.com/open?id=1M2JqlBzd4ZvrVErfPUUvYqHIv-krPcbs&quot; target=&quot;_blank&quot;&gt;Google Drive&lt;/a&gt; ou veja no &lt;/span&gt;&lt;a href=&quot;https://github.com/kellysc2013/dicas_sql_jquery/tree/master/artigo_copy_to/exemplo_2&quot; style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot; target=&quot;_blank&quot;&gt;GitHub&lt;/a&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJXnAFJ2Aq4nkDjYJmgZ1khfqbMaU1TwRslRtxbjL9KYuyBAZAuE50_Xgt2GuE__qlSNdhZ-vpEzMzhjecsTQ3gSa7ddKJ3VcdUuDELOiKLabrpnkqJNkN4wFshNc4Qg65K98CM8Alrzs/s1600/6+-+copy_tabela_estoque_registros.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;70&quot; data-original-width=&quot;587&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJXnAFJ2Aq4nkDjYJmgZ1khfqbMaU1TwRslRtxbjL9KYuyBAZAuE50_Xgt2GuE__qlSNdhZ-vpEzMzhjecsTQ3gSa7ddKJ3VcdUuDELOiKLabrpnkqJNkN4wFshNc4Qg65K98CM8Alrzs/s1600/6+-+copy_tabela_estoque_registros.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Dados da tabela estoque que serão expotados&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;span style=&quot;background-color: white; white-space: pre-wrap;&quot;&gt;Segue o comando \copy para exportar os dados para o arquivo estoque_sc.csv&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #073763;&quot;&gt;&lt;span style=&quot;color: black; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;color: #073763; white-space: normal;&quot;&gt;&lt;b&gt;\COPY&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #444444; white-space: normal;&quot;&gt;&lt;b&gt;(&amp;nbsp;&lt;/b&gt;&lt;b style=&quot;color: #351c75;&quot;&gt;SELECT&lt;/b&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #351c75; white-space: normal;&quot;&gt;&lt;b&gt;codigo&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;,&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #351c75; white-space: normal;&quot;&gt;&lt;b&gt;produto&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #351c75; white-space: normal;&quot;&gt;&lt;b&gt;categoria&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;,&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;marca&lt;/span&gt;&lt;span style=&quot;color: #444444;&quot;&gt;,&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #351c75; white-space: normal;&quot;&gt;&lt;b&gt;preco&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;,&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #351c75; white-space: normal;&quot;&gt;&lt;b&gt;quantidade FROM estoque&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #444444; white-space: normal;&quot;&gt;&lt;b&gt;)&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #134f5c; white-space: normal;&quot;&gt;&lt;b&gt;&amp;nbsp;to &#39;C:/temp/estoque_sc.csv&#39;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; font-family: inherit;&quot;&gt;&lt;span style=&quot;color: #783f04;&quot;&gt;&lt;b&gt;&amp;nbsp;WITH DELIMITER AS &#39;;&#39;&lt;/b&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihx8eznAAv-nQrL8zvBsebQ1dEd3hVcnZgM1NMIZD7LjKocvoDLm0HPybiqWOhAt-ax55h4QRDrhe3H05LsdAiQ6RgQUljCoX7Lxzl6Ub6i0KYqLdt0QdGbW4weZLbEZX31b3ESEH6FQo/s1600/copy_to_tab_estoque_to_arquivo_estoque_sc.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;76&quot; data-original-width=&quot;572&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihx8eznAAv-nQrL8zvBsebQ1dEd3hVcnZgM1NMIZD7LjKocvoDLm0HPybiqWOhAt-ax55h4QRDrhe3H05LsdAiQ6RgQUljCoX7Lxzl6Ub6i0KYqLdt0QdGbW4weZLbEZX31b3ESEH6FQo/s1600/copy_to_tab_estoque_to_arquivo_estoque_sc.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Comando \copy&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;Legenda:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 11pt; margin-top: 11pt;&quot;&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b style=&quot;color: #073763;&quot;&gt;\COPY&lt;/b&gt;: comando psql;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white; color: #444444;&quot;&gt;&lt;b&gt;(&lt;/b&gt;&lt;b style=&quot;color: #351c75;&quot;&gt;SELECT&lt;/b&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #351c75;&quot;&gt;&lt;b&gt;codigo&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;,&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background-color: white; color: #351c75;&quot;&gt;&lt;b&gt;produto&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background-color: white; color: #351c75;&quot;&gt;&lt;b&gt;categoria&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;,&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;marca&lt;/span&gt;&lt;span style=&quot;color: #444444;&quot;&gt;,&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #351c75;&quot;&gt;&lt;b&gt;preco&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;,&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #351c75;&quot;&gt;&lt;b&gt;quantidade FROM estoque&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #444444;&quot;&gt;&lt;b&gt;)&lt;/b&gt;&lt;/span&gt;: dentro do parenteses colocamos uma query (consulta da tabela estoque). Neste exemplo, foram exportadas todas as colunas da tabela estoque mas isto não é obrigatório, podemos colocar na query algumas colunas ou retornar apenas alguns registros utilizando WHERE na query;&lt;/li&gt;
&lt;li&gt;&lt;b style=&quot;color: #134f5c;&quot;&gt;to &#39;C:/temp/estoque_sc.csv&#39;&lt;/b&gt;:&lt;b style=&quot;color: #274e13;&quot;&gt;&amp;nbsp;&lt;/b&gt;após o &quot;to&quot; deverá ser colocado o nome do diretório, seguido pelo nome do arquivo e a extensão. Neste exemplo, a extensão é &quot;&lt;b style=&quot;color: #134f5c;&quot;&gt;.csv&lt;/b&gt;&quot; mas poderia ser &quot;&lt;span style=&quot;color: #0c343d;&quot;&gt;&lt;b&gt;.txt&lt;/b&gt;&lt;/span&gt;&quot;.&amp;nbsp;&lt;span style=&quot;color: #660000;&quot;&gt;Importante!!! Até mesmo no sistema operacional Windows, repare que&amp;nbsp;&lt;b&gt;NÃO&amp;nbsp;&lt;/b&gt;se deve utilizar a barra invertida &quot;&lt;b&gt;\&lt;/b&gt;&quot;, e sim a barra normal&amp;nbsp;&lt;b&gt;&quot;&lt;/b&gt;&lt;span style=&quot;color: #134f5c;&quot;&gt;&lt;b&gt;/&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&quot;&lt;/b&gt;&amp;nbsp;para identificar o diretório&lt;/span&gt;;&lt;/li&gt;
&lt;li&gt;&lt;b style=&quot;color: #783f04;&quot;&gt;WITH DELIMITER AS &#39;;&#39;&lt;/b&gt;: o delimitador serve para separar as colunas do arquivo. Após o &quot;&lt;b style=&quot;color: #783f04;&quot;&gt;WITH DELIMITER AS&lt;/b&gt;&quot;, coloque o delimitador. Neste exemplo, escolhemos o &quot;&lt;b style=&quot;color: #783f04;&quot;&gt;;&lt;/b&gt;&quot; mas o delimitador pode ser &quot;&lt;b&gt;|&lt;/b&gt;&quot; ou &quot;&lt;b&gt;,&lt;/b&gt;&quot; entre outros;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
Após executar o comando foi gerado um arquivo com 3 registros..&lt;/div&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmd4L1oqFVSJ73XXpX1URVtpPlWkHurvxaxjozivaYM2yMwsD9nAWpx2A1YMI94dnDYMQ8r0UqDXuPXfj4_d0sJ6eqXJAMPOWdmUfvM4iG44f1Cx292-ZJXrHKfG83lN2s6pjANvQHQLc/s1600/5+-+copy_arquivo_estoque_sc.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;149&quot; data-original-width=&quot;514&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmd4L1oqFVSJ73XXpX1URVtpPlWkHurvxaxjozivaYM2yMwsD9nAWpx2A1YMI94dnDYMQ8r0UqDXuPXfj4_d0sJ6eqXJAMPOWdmUfvM4iG44f1Cx292-ZJXrHKfG83lN2s6pjANvQHQLc/s1600/5+-+copy_arquivo_estoque_sc.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;font-size: 12.8px;&quot;&gt;Arquivo: estoque_sc.csv&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jquerydicas.blogspot.com/feeds/221483548940546830/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://jquerydicas.blogspot.com/2018/01/postgresql-exportar-dados-de-uma-tabela.html#comment-form' title='5 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/221483548940546830'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/221483548940546830'/><link rel='alternate' type='text/html' href='http://jquerydicas.blogspot.com/2018/01/postgresql-exportar-dados-de-uma-tabela.html' title='Postgresql - Exportar dados de uma tabela para um arquivo csv ou txt com o comando psql \copy'/><author><name>Kelly</name><uri>http://www.blogger.com/profile/03449060135636479990</uri><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/AVvXsEiHdjbBEK2W5T8GE4TQU1hfSH5O8Nb9-ReDPvZ8D5MtvF_6mi_JF6vmCcxE0lVesU2eAzJSP2k5gjg0Id9L1ZV7RM3cvZk3ZI3-hkmFPU935d6qzNmpcovDh2OYJ-7xi9jzP2gWnUNJdVM/s72-c/6+-+copy_tabela_estoque_registros.png" height="72" width="72"/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7010404629734647455.post-2399162325383102381</id><published>2017-12-30T16:36:00.001-02:00</published><updated>2018-01-14T15:35:52.682-02:00</updated><title type='text'>Postgresql - Importar dados de um arquivo csv ou txt com o comando psql \copy</title><content type='html'>&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;Através do comando &lt;span style=&quot;color: #0c343d;&quot;&gt;&lt;b&gt;psql&lt;/b&gt;&lt;/span&gt;&lt;b&gt; &lt;/b&gt;&lt;span style=&quot;background-color: white; color: #073763; white-space: normal;&quot;&gt;&lt;b&gt;\copy&lt;/b&gt;&lt;/span&gt; é possível importar dados de um arquivo para uma tabela.&lt;/span&gt; &lt;/span&gt;&lt;span style=&quot;font-family: inherit; white-space: pre-wrap;&quot;&gt;O arquivo pode estar &lt;/span&gt;&lt;b style=&quot;font-family: inherit; white-space: pre-wrap;&quot;&gt;localizado&lt;/b&gt;&lt;span style=&quot;font-family: inherit; white-space: pre-wrap;&quot;&gt; tanto no &lt;/span&gt;&lt;b style=&quot;font-family: inherit; white-space: pre-wrap;&quot;&gt;servidor&lt;/b&gt;&lt;span style=&quot;font-family: inherit; white-space: pre-wrap;&quot;&gt; quanto em uma máquina &lt;/span&gt;&lt;b style=&quot;font-family: inherit; white-space: pre-wrap;&quot;&gt;cliente&lt;/b&gt;&lt;span style=&quot;font-family: inherit; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit; white-space: pre-wrap;&quot;&gt;Neste exemplo, vamos executar os comandos do cliente psql através do prompt de comando do Windows. &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit; white-space: pre-wrap;&quot;&gt;Em breve, será postado como executar os comandos no terminal linux.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;Não confunda com o&lt;span style=&quot;color: red; font-weight: bold;&quot;&gt; comando sql &lt;/span&gt;&lt;b style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;copy&lt;/span&gt;&lt;/b&gt;, onde o arquivo deve estar &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;obrigatoriamente&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt; no servidor. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;background-color: white; line-height: 1.38; margin-bottom: 11pt; margin-top: 11pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;Para saber mais sobre o &lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;comando sql copy&lt;/span&gt;&lt;/b&gt; acesse o link: &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href=&quot;http://jquerydicas.blogspot.com.br/2013/10/postgre-importar-arquivo-csv-e-txt.html&quot; style=&quot;font-family: inherit;&quot; target=&quot;_blank&quot;&gt;Postgresql - Importar arquivo csv e txt&lt;/a&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;background-color: white; line-height: 1.38; margin-bottom: 11pt; margin-top: 11pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: large;&quot;&gt;1º) Exemplo&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: transparent; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: transparent; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Vamos importar os dados do arquivo &quot;estoque&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; white-space: pre-wrap;&quot;&gt;.csv&quot; localizado no diretório &quot;C:\temp&quot; da &lt;b&gt;máquina cliente&lt;/b&gt; para a tabela &quot;estoque&quot;, contida no &lt;/span&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;banco de dados &quot;db_rem&quot;, localizado no&lt;/span&gt;&lt;span style=&quot;background-color: transparent; white-space: pre-wrap;&quot;&gt; &lt;b&gt;servidor&lt;/b&gt; &quot;104.197.20.162&quot;. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt;Caso tenha interesse, faça o &lt;/span&gt;download&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt; deste exemplo no &lt;a href=&quot;https://drive.google.com/open?id=1HlqsYx498AW9oDqSgfqJs5nM-U16LWa9&quot; target=&quot;_blank&quot;&gt;Google Drive&lt;/a&gt; ou veja no &lt;/span&gt;&lt;a href=&quot;https://github.com/kellysc2013/dicas_sql_jquery/tree/master/artigo_comando_psql_copy/1_exemplo&quot; style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot; target=&quot;_blank&quot;&gt;GitHub&lt;/a&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Note que este arquivo possui cabeçalho na 1ª linha&lt;/span&gt;:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;O cabeçalho é:&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;color: #073763; font-family: inherit;&quot;&gt;&lt;b&gt;codigo;produto;categoria;marca;preco;quantidade&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLToo1avXkPhsxymgkP5HsA4G8VdpxvAyw3Mp0Er8KnTTv3jgIQv4ORxV4wHlHmHbL22T7cesK_foBlcQUZv_96AezAufecp9XFHmQb16rePfCxW6Faa38V_gq2hTg08bgeXTMUtTlSGc/s1600/5+-+copy_arquivo_estoque.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;186&quot; data-original-width=&quot;541&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLToo1avXkPhsxymgkP5HsA4G8VdpxvAyw3Mp0Er8KnTTv3jgIQv4ORxV4wHlHmHbL22T7cesK_foBlcQUZv_96AezAufecp9XFHmQb16rePfCxW6Faa38V_gq2hTg08bgeXTMUtTlSGc/s1600/5+-+copy_arquivo_estoque.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Arquivo: estoque.csv&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigVuHvCyaCUTPakr6GZMl2ZICoDR9pQthDwXu6hVrGACuK3asRrdju1Ogx06Hs8XrUrftQeDGtH0hGuMVsitTKt-oMA0HK4VRJcl8ix-2532qEhfzUh7cOnRlSq3XjOzdaqFr01mPlvHA/s1600/diretorio_c_temp.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;274&quot; data-original-width=&quot;556&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigVuHvCyaCUTPakr6GZMl2ZICoDR9pQthDwXu6hVrGACuK3asRrdju1Ogx06Hs8XrUrftQeDGtH0hGuMVsitTKt-oMA0HK4VRJcl8ix-2532qEhfzUh7cOnRlSq3XjOzdaqFr01mPlvHA/s1600/diretorio_c_temp.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Diretório C:\temp&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;text-align: center;&quot;&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;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgK5KHpmzlPUneKtINo0zLbZF9cA1S33KgXQ7xghtgAuvRjuZ8dKS8Vm-10KHn95vfFSNJfvyfO4pVin-7BB4IbavbFESZ3_x-vXBUm3A20ZFyYlm4PtISMj93mWs2TjIWFYaA7chIzc5o/s1600/4+-+copy_localizacao_script_tabela_estoque.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;496&quot; data-original-width=&quot;515&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgK5KHpmzlPUneKtINo0zLbZF9cA1S33KgXQ7xghtgAuvRjuZ8dKS8Vm-10KHn95vfFSNJfvyfO4pVin-7BB4IbavbFESZ3_x-vXBUm3A20ZFyYlm4PtISMj93mWs2TjIWFYaA7chIzc5o/s1600/4+-+copy_localizacao_script_tabela_estoque.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Localização e script da tabela &quot;estoque&quot;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
Para a importação siga as etapas abaixo:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&lt;/span&gt;a) Abra o prompt de comando.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpf0HY9z20qyEuJvW0jujNTqUU0W4oLS9lLamjYUQ9okHAASPfmPld4V7gTNLfVAFiiIXM8G_DWTcnxAmaXOh5XlJCx4DriLhq-e5ZBvFyVlydJ7wkkTAPhJ9ZyGZ_IPx7YLMbI0JDX-w/s1600/7+-+Abrir+prompt+de+comando+no+windows.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;121&quot; data-original-width=&quot;473&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpf0HY9z20qyEuJvW0jujNTqUU0W4oLS9lLamjYUQ9okHAASPfmPld4V7gTNLfVAFiiIXM8G_DWTcnxAmaXOh5XlJCx4DriLhq-e5ZBvFyVlydJ7wkkTAPhJ9ZyGZ_IPx7YLMbI0JDX-w/s1600/7+-+Abrir+prompt+de+comando+no+windows.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Prompt de Comando&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt;b) Faça a autenticação no servidor.&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: transparent; font-family: inherit; font-size: 15.3333px; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhahZsPsLNZ6BrXAWjDiydC4iFD_JijBxOf-hS7xSh9B7ieKf80IxtJtlh0r6dSNigfQGanxXZA1lqxJ-IJoM0Mc3gSsUWr0u9jNBPrXu9MLM3dJLIbJvBMwpTv7z0KT6UNRARiENcTlFM/s1600/1+-+copy_autenticacao.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;57&quot; data-original-width=&quot;387&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhahZsPsLNZ6BrXAWjDiydC4iFD_JijBxOf-hS7xSh9B7ieKf80IxtJtlh0r6dSNigfQGanxXZA1lqxJ-IJoM0Mc3gSsUWr0u9jNBPrXu9MLM3dJLIbJvBMwpTv7z0KT6UNRARiENcTlFM/s1600/1+-+copy_autenticacao.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Autenticação&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt;Segue o comando: &lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt;psql&lt;/b&gt;&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #274e13; font-family: inherit; white-space: pre-wrap;&quot;&gt;&lt;b&gt;-h 104.197.20.162&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #073763; font-family: inherit; white-space: pre-wrap;&quot;&gt;&lt;b&gt;-d db_rem&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #741b47; font-family: inherit; white-space: pre-wrap;&quot;&gt;&lt;b&gt;-U postgres&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt;Legenda:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt;&lt;b style=&quot;color: #274e13;&quot;&gt;-h&lt;/b&gt;: ip ou nome do host;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt;&lt;b style=&quot;color: #073763;&quot;&gt;-d&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;: nome do banco de dados;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;color: #741b47; white-space: pre-wrap;&quot;&gt;-U&lt;/b&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;: nome do usuário;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;c) Será solicitada a senha, repare que ao digitar a senha não serão exibidos os caracteres. Digite a senha e pressione &quot;Enter&quot;.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;d)&lt;/span&gt;&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt; Agora utilize o comando \copy para importar os dados para a tabela estoque:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;color: #073763; white-space: normal;&quot;&gt;&lt;b&gt;\copy&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;color: #274e13; white-space: normal;&quot;&gt;estoque&lt;/b&gt;&lt;span style=&quot;color: #444444; white-space: normal;&quot;&gt;&lt;b&gt;(&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #351c75; white-space: normal;&quot;&gt;&lt;b&gt;codigo&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #351c75; white-space: normal;&quot;&gt;&lt;b&gt;produto&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #351c75; white-space: normal;&quot;&gt;&lt;b&gt;categoria&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;,&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;marca&lt;/span&gt;&lt;span style=&quot;color: #444444;&quot;&gt;,&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #351c75; white-space: normal;&quot;&gt;&lt;b&gt;preco&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;,&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #351c75; white-space: normal;&quot;&gt;&lt;b&gt;quantidade&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #444444; white-space: normal;&quot;&gt;&lt;b&gt;)&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #134f5c; white-space: normal;&quot;&gt;&lt;b&gt;&amp;nbsp;from &#39;C:/temp/estoque.csv&#39;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;color: #783f04;&quot;&gt;&lt;b&gt;with delimiter as &#39;;&#39;&lt;/b&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;b&gt;CSV HEADER&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEie6eJJ4H2WyP-RfnxdbJh1omj0GnfzwMSzpjjirzQimsQqUAoyB3rf8eVHCugONMl2jmWcYiDITSkApINLezyQzWSuR_eENHRRPrlzdY-0fsaCQ5RNWLgQSF-jpzQMVR6uWLN_wLo2ZqA/s1600/copy_from_com_cabecalho.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;95&quot; data-original-width=&quot;560&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEie6eJJ4H2WyP-RfnxdbJh1omj0GnfzwMSzpjjirzQimsQqUAoyB3rf8eVHCugONMl2jmWcYiDITSkApINLezyQzWSuR_eENHRRPrlzdY-0fsaCQ5RNWLgQSF-jpzQMVR6uWLN_wLo2ZqA/s1600/copy_from_com_cabecalho.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Comando \copy&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;background-color: white; line-height: 1.38; margin-bottom: 11pt; margin-top: 11pt;&quot;&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;/div&gt;
Legenda:&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 11pt; margin-top: 11pt;&quot;&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b style=&quot;color: #073763;&quot;&gt;\copy&lt;/b&gt;: comando psql;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;b&gt;estoque&lt;/b&gt;&lt;/span&gt;:&amp;nbsp;nesta tabela serão incluídos os registros que estão no arquivo;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;codigo&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #444444;&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;produto&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #444444;&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;categoria&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #444444;&quot;&gt;,&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;marca&lt;/span&gt;&lt;span style=&quot;color: #444444;&quot;&gt;,&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;preco&lt;/span&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp;&lt;/span&gt;e&lt;/b&gt;&amp;nbsp;&lt;span style=&quot;color: #351c75; font-weight: bold;&quot;&gt;quantidade&lt;/span&gt;:&lt;b&gt;&amp;nbsp;&lt;/b&gt;nome das colunas;&lt;/li&gt;
&lt;li&gt;&lt;b style=&quot;color: #134f5c;&quot;&gt;from&amp;nbsp;&#39;&lt;b style=&quot;background-color: white;&quot;&gt;C:/temp/&lt;/b&gt;estoque.csv&#39;&lt;/b&gt;:&lt;b style=&quot;color: #274e13;&quot;&gt;&amp;nbsp;&lt;/b&gt;após o &quot;from&quot; deverá ser colocado o nome do diretório, seguido pelo nome do arquivo e a extensão. Neste exemplo, a extensão é &quot;&lt;b style=&quot;color: #134f5c;&quot;&gt;.csv&lt;/b&gt;&quot; mas poderia ser &quot;&lt;span style=&quot;color: #0c343d;&quot;&gt;&lt;b&gt;.txt&lt;/b&gt;&lt;/span&gt;&quot;.&amp;nbsp;&lt;span style=&quot;color: #660000;&quot;&gt;Importante!!! Até mesmo no sistema operacional Windows, repare que &lt;b&gt;NÃO &lt;/b&gt;se deve utilizar a barra invertida &quot;&lt;b&gt;\&lt;/b&gt;&quot;, e sim a barra normal &lt;b&gt;&quot;&lt;/b&gt;&lt;span style=&quot;color: #134f5c;&quot;&gt;&lt;b&gt;/&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&quot;&lt;/b&gt; para identificar o diretório&lt;/span&gt;;&lt;/li&gt;
&lt;li&gt;&lt;b style=&quot;color: #783f04;&quot;&gt;with delimiter as &#39;;&#39;&lt;/b&gt;: o delimitador serve para separar as colunas. Após o &quot;with&amp;nbsp; delimiter as&quot;, coloque o delimitador. Neste exemplo é o &quot;&lt;b style=&quot;color: #783f04;&quot;&gt;;&lt;/b&gt;&quot; mas o delimitador pode ser &quot;&lt;b&gt;|&lt;/b&gt;&quot; ou &quot;&lt;b&gt;,&lt;/b&gt;&quot; entre outros;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;CSV HEADER&lt;/b&gt;: este parâmetro indica que o arquivo possui cabeçalho;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
Após executar o comando, 3 registros foram inseridos na tabela.&lt;br /&gt;
&lt;br /&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;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: left; margin-right: 1em; text-align: left;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHdjbBEK2W5T8GE4TQU1hfSH5O8Nb9-ReDPvZ8D5MtvF_6mi_JF6vmCcxE0lVesU2eAzJSP2k5gjg0Id9L1ZV7RM3cvZk3ZI3-hkmFPU935d6qzNmpcovDh2OYJ-7xi9jzP2gWnUNJdVM/s1600/6+-+copy_tabela_estoque_registros.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;70&quot; data-original-width=&quot;587&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHdjbBEK2W5T8GE4TQU1hfSH5O8Nb9-ReDPvZ8D5MtvF_6mi_JF6vmCcxE0lVesU2eAzJSP2k5gjg0Id9L1ZV7RM3cvZk3ZI3-hkmFPU935d6qzNmpcovDh2OYJ-7xi9jzP2gWnUNJdVM/s1600/6+-+copy_tabela_estoque_registros.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Registros importados&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
&lt;span style=&quot;font-size: large; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: large; white-space: pre-wrap;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large; white-space: pre-wrap;&quot;&gt;&lt;b&gt;2º) Exemplo&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Neste exemplo, vamos importar um arquivo &lt;b&gt;sem&lt;/b&gt; cabeçalho chamado &quot;estoque_sc&lt;/span&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;.csv&quot;. O procedimento é o mesmo do anterior com exceção do comando &lt;b style=&quot;color: #073763; white-space: normal;&quot;&gt;\copy&lt;/b&gt; &lt;span style=&quot;color: #660000;&quot;&gt;&lt;b&gt;que NÃO será utilizado o parâmetro&lt;/b&gt;&lt;/span&gt; &lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;b&gt;CSV HEADER&lt;/b&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt;Caso tenha interesse, faça o &lt;/span&gt;download&lt;span style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot;&gt; deste exemplo no &lt;a href=&quot;https://drive.google.com/open?id=1jHjfRrOr2an5xPFAOPSynZ2u6ALrstDA&quot; target=&quot;_blank&quot;&gt;Google Drive&lt;/a&gt; ou veja no &lt;/span&gt;&lt;a href=&quot;https://github.com/kellysc2013/dicas_sql_jquery/tree/master/artigo_comando_psql_copy/2-exemplo&quot; style=&quot;background-color: transparent; font-family: inherit; white-space: pre-wrap;&quot; target=&quot;_blank&quot;&gt;GitHub&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmd4L1oqFVSJ73XXpX1URVtpPlWkHurvxaxjozivaYM2yMwsD9nAWpx2A1YMI94dnDYMQ8r0UqDXuPXfj4_d0sJ6eqXJAMPOWdmUfvM4iG44f1Cx292-ZJXrHKfG83lN2s6pjANvQHQLc/s1600/5+-+copy_arquivo_estoque_sc.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;149&quot; data-original-width=&quot;514&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmd4L1oqFVSJ73XXpX1URVtpPlWkHurvxaxjozivaYM2yMwsD9nAWpx2A1YMI94dnDYMQ8r0UqDXuPXfj4_d0sJ6eqXJAMPOWdmUfvM4iG44f1Cx292-ZJXrHKfG83lN2s6pjANvQHQLc/s1600/5+-+copy_arquivo_estoque_sc.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Arquivo: estoque_sc.csv&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;span style=&quot;background-color: white; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; white-space: pre-wrap;&quot;&gt;Segue o comando \copy para importar os dados para a tabela estoque:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #073763;&quot;&gt;&lt;span style=&quot;color: black; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; color: #073763;&quot;&gt;&lt;b&gt;\copy&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;background-color: white; color: #274e13;&quot;&gt;estoque&lt;/b&gt;&lt;span style=&quot;background-color: white; color: #444444;&quot;&gt;&lt;b&gt;(&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #351c75;&quot;&gt;&lt;b&gt;codigo&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background-color: white; color: #351c75;&quot;&gt;&lt;b&gt;produto&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background-color: white; color: #351c75;&quot;&gt;&lt;b&gt;categoria&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;,&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;marca&lt;/span&gt;&lt;span style=&quot;color: #444444;&quot;&gt;,&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #351c75;&quot;&gt;&lt;b&gt;preco&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;,&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #351c75;&quot;&gt;&lt;b&gt;quantidade&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #444444;&quot;&gt;&lt;b&gt;)&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #134f5c;&quot;&gt;&lt;b&gt;&amp;nbsp;from &#39;C:/temp/estoque_sc.csv&#39;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #783f04;&quot;&gt;&lt;b&gt;with delimiter as &#39;;&#39;&lt;/b&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #783f04;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8bKrBuxNFRLgbZb-50uJZECuqeqSzh6l6D3RfFJ45VQ4DYCu6Sp0yl7VMdyvUoqyGwDC3HaE8EUhy1osUHBmxzkp_5h_mmOyhj7vo8sne7TUwwi1m8wN_9SQQcK07XYXS45qM57JH5co/s1600/copy_from_sem_cabecalho.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;100&quot; data-original-width=&quot;557&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8bKrBuxNFRLgbZb-50uJZECuqeqSzh6l6D3RfFJ45VQ4DYCu6Sp0yl7VMdyvUoqyGwDC3HaE8EUhy1osUHBmxzkp_5h_mmOyhj7vo8sne7TUwwi1m8wN_9SQQcK07XYXS45qM57JH5co/s1600/copy_from_sem_cabecalho.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Comando \copy&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&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;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
&lt;br /&gt;
Legenda:&lt;/div&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b style=&quot;color: #073763;&quot;&gt;\copy&lt;/b&gt;: comando psql;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;b&gt;estoque&lt;/b&gt;&lt;/span&gt;:&amp;nbsp;nesta tabela serão incluídos os registros que estão no arquivo;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;codigo&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #444444;&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;produto&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #444444;&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;categoria&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #444444;&quot;&gt;,&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;marca&lt;/span&gt;&lt;span style=&quot;color: #444444;&quot;&gt;,&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;preco&lt;/span&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp;&lt;/span&gt;e&lt;/b&gt;&amp;nbsp;&lt;span style=&quot;color: #351c75; font-weight: bold;&quot;&gt;quantidade&lt;/span&gt;:&lt;b&gt;&amp;nbsp;&lt;/b&gt;nome das colunas;&lt;/li&gt;
&lt;li&gt;&lt;b style=&quot;color: #134f5c;&quot;&gt;from&amp;nbsp;&#39;C:/temp/estoque_sc.csv&#39;&lt;/b&gt;:&lt;b style=&quot;color: #274e13;&quot;&gt;&amp;nbsp;&lt;/b&gt;após o &quot;from&quot; deverá ser colocado o nome do diretório, seguido pelo nome do arquivo e a extensão. Neste exemplo, a extensão é &quot;&lt;b style=&quot;color: #134f5c;&quot;&gt;.csv&lt;/b&gt;&quot; mas poderia ser &quot;&lt;span style=&quot;color: #0c343d;&quot;&gt;&lt;b&gt;.txt&lt;/b&gt;&lt;/span&gt;&quot;.&amp;nbsp;&lt;span style=&quot;color: #660000;&quot;&gt;Importante!!! Até mesmo no sistema operacional Windows, repare que&amp;nbsp;&lt;b&gt;NÃO&amp;nbsp;&lt;/b&gt;se deve utilizar a barra invertida &quot;&lt;b&gt;\&lt;/b&gt;&quot;, e sim a barra normal&amp;nbsp;&lt;b&gt;&quot;&lt;/b&gt;&lt;span style=&quot;color: #134f5c;&quot;&gt;&lt;b&gt;/&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&quot;&lt;/b&gt;&amp;nbsp;para identificar o diretório&lt;/span&gt;;&lt;/li&gt;
&lt;li&gt;&lt;b style=&quot;color: #783f04;&quot;&gt;with delimiter as &#39;;&#39;&lt;/b&gt;: o delimitador serve para separar as colunas. Após o &quot;with&amp;nbsp; delimiter as&quot;, coloque o delimitador. Neste exemplo é o &quot;&lt;b style=&quot;color: #783f04;&quot;&gt;;&lt;/b&gt;&quot; mas o delimitador pode ser &quot;&lt;b&gt;|&lt;/b&gt;&quot; &amp;nbsp;ou &quot;,&quot;&amp;nbsp; entre outros;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
Após executar o comando, 3 registros foram inseridos na tabela.&lt;/div&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
&lt;br /&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: left; margin-right: 1em; text-align: left;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOqtjbi67fVRlSRWGEg1HUmnaopIXRh348vMD103egqsw_hQ_KaGWljDwFW-MS1JwdvSsirOC3xg_8JxsgRnydLYRRBvdSIXpfEEwcZDKpMXIhY3E-UNFKx1R2I8snY2QRWu_DdpWeS3c/s1600/6+-+copy_tabela_estoque_registros.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;70&quot; data-original-width=&quot;587&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOqtjbi67fVRlSRWGEg1HUmnaopIXRh348vMD103egqsw_hQ_KaGWljDwFW-MS1JwdvSsirOC3xg_8JxsgRnydLYRRBvdSIXpfEEwcZDKpMXIhY3E-UNFKx1R2I8snY2QRWu_DdpWeS3c/s1600/6+-+copy_tabela_estoque_registros.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Registros Importados&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jquerydicas.blogspot.com/feeds/2399162325383102381/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://jquerydicas.blogspot.com/2017/12/postgresql-importar-dados-de-um-arquivo.html#comment-form' title='2 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/2399162325383102381'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/2399162325383102381'/><link rel='alternate' type='text/html' href='http://jquerydicas.blogspot.com/2017/12/postgresql-importar-dados-de-um-arquivo.html' title='Postgresql - Importar dados de um arquivo csv ou txt com o comando psql \copy'/><author><name>Kelly</name><uri>http://www.blogger.com/profile/03449060135636479990</uri><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/AVvXsEgLToo1avXkPhsxymgkP5HsA4G8VdpxvAyw3Mp0Er8KnTTv3jgIQv4ORxV4wHlHmHbL22T7cesK_foBlcQUZv_96AezAufecp9XFHmQb16rePfCxW6Faa38V_gq2hTg08bgeXTMUtTlSGc/s72-c/5+-+copy_arquivo_estoque.png" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7010404629734647455.post-3354061126706193777</id><published>2017-11-15T16:01:00.001-02:00</published><updated>2017-11-15T16:43:58.372-02:00</updated><title type='text'>Postgresql - Listar colunas de uma tabela</title><content type='html'>Neste post vamos mostrar como listar as colunas de uma tabela no Postgresql.&lt;br /&gt;
&lt;br /&gt;
Para você que está familiarizado com o mysql ou oracle, é equivalente ao comando &quot;describe&quot;.&lt;br /&gt;
&lt;br /&gt;
Há duas formas de exibir as colunas de uma tabela.&amp;nbsp; A primeira é utilizar um comando psql e a segunda é fazer uma consulta utilizando o &quot;information_schema&quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;1ª )&lt;/b&gt;&amp;nbsp;Utilizar comando psql;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;\d+ nome_da_tabela&lt;/b&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Exemplo&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
Listar as colunas da tabela &quot;tb_uf&quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;\d+&lt;/span&gt; &lt;span style=&quot;color: #073763;&quot;&gt;tb_uf&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;overflow-x: scroll; width: 580px;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTy42rBgT9aHjCiVGplo1HhMrxfYFtoSc4qjQI72oc5rgSyTElEbzraHNtMUPhc4j2cnuJzLKSr20q6TjnONixSqJCRnkAa9zo8fnDGIKMzEIgcKc0avSDUBUjnKh0XwuZXyx-03cHqio/s1600/listar_%20colunas_de_uma_tabela_ex_1.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 0em; margin-right: 0em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;97&quot; data-original-width=&quot;679&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTy42rBgT9aHjCiVGplo1HhMrxfYFtoSc4qjQI72oc5rgSyTElEbzraHNtMUPhc4j2cnuJzLKSr20q6TjnONixSqJCRnkAa9zo8fnDGIKMzEIgcKc0avSDUBUjnKh0XwuZXyx-03cHqio/s1600/listar_colunas_de_uma_tabela_ex_1.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;2ª )&lt;/b&gt;&amp;nbsp;Utilizar a view &quot;&lt;b style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;columns&lt;/span&gt;&lt;/b&gt;&quot;. Esta view já está localizada por padrão no catálogo de objetos do Postgresql, em information_schema.&lt;br /&gt;
O information_schema é um padrão ANSI, que contém views que fornecem informações sobre o banco de dados: tabelas, views, colunas e procedures.&lt;br /&gt;
&lt;br /&gt;
Veja a sua localização na imagem abaixo:&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/AVvXsEhwcDF7s4NKkLhUmp8XW8hFmBrm7LOZj_NXzAX7FEBmrJamcx-AUpriE_nBFYHYv7O40RuEbPPyLUqkH0biVfFDxHrJByJ4Bx57E8QKYdEbXRcuKKwSs_cyldoWvJVd_xxTJg9m3zY0WxA/s1600/catalogo_objetos_tabela_columns.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;515&quot; data-original-width=&quot;361&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwcDF7s4NKkLhUmp8XW8hFmBrm7LOZj_NXzAX7FEBmrJamcx-AUpriE_nBFYHYv7O40RuEbPPyLUqkH0biVfFDxHrJByJ4Bx57E8QKYdEbXRcuKKwSs_cyldoWvJVd_xxTJg9m3zY0WxA/s1600/catalogo_objetos_tabela_columns.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Exemplo&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
Agora vamos listar as colunas da tabela &quot;tb_uf&quot;, utilizando a view &quot;&lt;b style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;columns&lt;/span&gt;&lt;/b&gt;&quot; , em information_schema.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;b&gt;SELECT&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;b style=&quot;color: #073763;&quot;&gt;column_name,&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;b style=&quot;color: #073763;&quot;&gt;data_type,&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;table_catalog,&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;table_name,&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;ordinal_position,&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;is_nullable,&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;color: #073763;&quot;&gt;table_schema&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;b&gt;FROM&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #20124d;&quot;&gt;&lt;b&gt;information_schema.columns&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;b&gt;WHERE&lt;/b&gt;&lt;/span&gt; &lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;table_name &lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color: #4c1130;&quot;&gt;&lt;b&gt; &#39;tb_uf&#39;;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #4c1130;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
Veja a imagem abaixo:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;overflow-x: scroll; width: 580px;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTQ334OSI9HiJD0OZYMXNKBMV_gwY4qlOLyLrbXp-5jJFQ5YnDbVKwRD4ifRO3MD_E_TveSmy-lVS8NVmAjWdJ3dtDjzRBpX6gy9V5vctRmMVAuNBv3RltZzBPkRDs8qyAnQNz4cVMW6M/s1600/listar_colunas_de_uma_tabela_ex_2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;64&quot; data-original-width=&quot;865&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTQ334OSI9HiJD0OZYMXNKBMV_gwY4qlOLyLrbXp-5jJFQ5YnDbVKwRD4ifRO3MD_E_TveSmy-lVS8NVmAjWdJ3dtDjzRBpX6gy9V5vctRmMVAuNBv3RltZzBPkRDs8qyAnQNz4cVMW6M/s1600/listar_colunas_de_uma_tabela_ex_2.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Descrevemos algumas informações sobre as colunas da view &quot;&lt;b style=&quot;color: #20124d;&quot;&gt;columns&lt;/b&gt;&quot;. Listamos a seguir:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b style=&quot;color: #073763;&quot;&gt;column_name&lt;/b&gt;: armazena o nome da coluna. Neste exemplo temos as colunas &quot;uf_cod&quot; e&amp;nbsp;&amp;nbsp;&quot;uf_descricao&quot;;&lt;/li&gt;
&lt;li&gt;&lt;b style=&quot;color: #073763;&quot;&gt;data_type&lt;/b&gt;: armazena o tipo de dado da coluna. Neste exemplo temos os tipos character varying (varchar), utilizados para armazenar caracteres alfanuméricos e o tipo smallint utilizados para armazenar números inteiros no intervalo de&amp;nbsp;&lt;span style=&quot;background-color: #efefef;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;-32768 até +32767;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;b style=&quot;color: #073763;&quot;&gt;table_catalog&lt;/b&gt;: em qual banco a coluna foi criada. Neste exemplo as colunas foram criadas no banco &quot;db_01&quot;;&lt;/li&gt;
&lt;li&gt;&lt;b style=&quot;color: #073763;&quot;&gt;table_name&lt;/b&gt;: em qual tabela a coluna foi criada. Neste exemplo, as colunas pertencem a tabela &quot;tb_uf&quot;;&lt;/li&gt;
&lt;li&gt;&lt;b style=&quot;color: #073763;&quot;&gt;ordinal_position&lt;/b&gt;: ordem de criação de uma coluna em uma tabela, ou seja, 1ª coluna, 2ª coluna, e assim por diante. No exemplo acima, a coluna &quot;uf_cod&quot; é a 1ª&amp;nbsp;coluna e a coluna &quot;uf_descricao&quot; é a 2ª coluna;&lt;/li&gt;
&lt;li&gt;&lt;b style=&quot;color: #073763;&quot;&gt;is_nullable&lt;/b&gt;: indica se o preenchimento da coluna é obrigatório ou não. Se o conteúdo for &quot;YES&quot;, significa, que o preenchimento é opcional. Se &quot;NO&quot;, indica que a coluna deve ser preenchida obrigatoriamente. Neste exemplo, as duas colunas tem preenchimento opcional;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;b style=&quot;color: #073763;&quot;&gt;table_schema&lt;/b&gt;: nome do schema que pertence a coluna. Neste exemplo, as colunas pertencem ao schema public, que é o schema padrão do postgresql;&lt;/li&gt;
&lt;/ul&gt;
Para visualizar toda as colunas, execute o comando:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;b&gt;SELECT&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;*&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;b&gt;FROM&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #20124d;&quot;&gt;&lt;b&gt;information_schema.columns&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;b&gt;WHERE&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;table_name&amp;nbsp;&lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color: #4c1130;&quot;&gt;&lt;b&gt;&amp;nbsp;&#39;tb_uf&#39;;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #4c1130;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
Para saber mais sobre o assunto acesse:&lt;br /&gt;
&lt;span style=&quot;color: #4c1130;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;https://www.postgresql.org/docs/9.3/static/infoschema-columns.html&quot;&gt;https://www.postgresql.org/docs/9.3/static/infoschema-columns.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://jquerydicas.blogspot.com/feeds/3354061126706193777/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://jquerydicas.blogspot.com/2017/11/postgresql-listar-colunas-de-uma-tabela.html#comment-form' title='1 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/3354061126706193777'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/3354061126706193777'/><link rel='alternate' type='text/html' href='http://jquerydicas.blogspot.com/2017/11/postgresql-listar-colunas-de-uma-tabela.html' title='Postgresql - Listar colunas de uma tabela'/><author><name>Kelly</name><uri>http://www.blogger.com/profile/03449060135636479990</uri><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/AVvXsEgTy42rBgT9aHjCiVGplo1HhMrxfYFtoSc4qjQI72oc5rgSyTElEbzraHNtMUPhc4j2cnuJzLKSr20q6TjnONixSqJCRnkAa9zo8fnDGIKMzEIgcKc0avSDUBUjnKh0XwuZXyx-03cHqio/s72-c/listar_colunas_de_uma_tabela_ex_1.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7010404629734647455.post-88927802771866899</id><published>2017-11-12T12:11:00.002-02:00</published><updated>2017-11-12T12:51:15.667-02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Find all tables containing column with specified name"/><title type='text'>Procurar tabelas que contenham uma coluna com um nome especifico - Postgresql</title><content type='html'>Para pesquisar quais as tabelas contém uma coluna com um nome específico, vamos utilizar a view &quot;&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;b&gt;columns&lt;/b&gt;&lt;/span&gt;&quot;.&lt;br /&gt;
&lt;br /&gt;
Esta view já está localizada por padrão no catálogo de objetos do Postgresql, em&amp;nbsp;&lt;b style=&quot;color: #20124d;&quot;&gt;information_schema&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
O information_schema é um padrão ANSI, que contém views que fornecem informações sobre o banco de dados: tabelas, views, colunas e procedures.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;Veja a sua localização na imagem abaixo:&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/AVvXsEhwcDF7s4NKkLhUmp8XW8hFmBrm7LOZj_NXzAX7FEBmrJamcx-AUpriE_nBFYHYv7O40RuEbPPyLUqkH0biVfFDxHrJByJ4Bx57E8QKYdEbXRcuKKwSs_cyldoWvJVd_xxTJg9m3zY0WxA/s1600/catalogo_objetos_tabela_columns.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;515&quot; data-original-width=&quot;361&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwcDF7s4NKkLhUmp8XW8hFmBrm7LOZj_NXzAX7FEBmrJamcx-AUpriE_nBFYHYv7O40RuEbPPyLUqkH0biVfFDxHrJByJ4Bx57E8QKYdEbXRcuKKwSs_cyldoWvJVd_xxTJg9m3zY0WxA/s1600/catalogo_objetos_tabela_columns.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;1º) Exemplo:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Procurar todas as tabelas que contenham a coluna &quot;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;b&gt;cod_uf&lt;/b&gt;&lt;/span&gt; &quot;?&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;b&gt;SELECT&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;table_name&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;FROM&lt;/span&gt; &lt;/b&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;&lt;b&gt;information_schema.columns&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;b&gt;WHERE&lt;/b&gt;&lt;/span&gt; &lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;b&gt;column_name&lt;/b&gt;&lt;/span&gt;&amp;nbsp; =&amp;nbsp; &lt;span style=&quot;color: #4c1130; font-weight: bold;&quot;&gt;&#39;cod_uf&#39;&lt;/span&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;b&gt;;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #4c1130;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
Ao executarmos a consulta acima, será retornado o resultado exibido na imagem abaixo:&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&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/AVvXsEiOhL8F3VZ0VLdDyRhdBqVHwb4peVlSwRGcheSx7fjJ-QMTWBe6wRMFFl1ntOfW-W3ywluaaO3jaOTbGZbuPU2xweZVdp8DcNd1VpbwihQThBcyiAhTdGC6EEK7GtJbq4V0N_s2JmR37hs/s1600/tabelas_que_contem_coluna_chamada_cod_uf.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;90&quot; data-original-width=&quot;132&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOhL8F3VZ0VLdDyRhdBqVHwb4peVlSwRGcheSx7fjJ-QMTWBe6wRMFFl1ntOfW-W3ywluaaO3jaOTbGZbuPU2xweZVdp8DcNd1VpbwihQThBcyiAhTdGC6EEK7GtJbq4V0N_s2JmR37hs/s1600/tabelas_que_contem_coluna_chamada_cod_uf.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Logo, a coluna &quot;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;b&gt;cod_uf&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&quot;, pode ser encontrada na tabela &quot;tb_municipio&quot; e &quot;tb_estado&quot;.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Legenda:&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;color: #0b5394; font-weight: bold;&quot;&gt;table_name&lt;/span&gt;: indica qual tabela a coluna pertence;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;b&gt;column_name&lt;/b&gt;&lt;/span&gt;: armazena o nome da coluna;&lt;/li&gt;
&lt;li&gt;&lt;b style=&quot;color: #20124d;&quot;&gt;columns&lt;/b&gt;: esta view por padrão armazena informações sobre as colunas do banco;&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;2º) Exemplo:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Procurar todas as tabelas que contenham colunas iniciadas por &quot;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;b&gt;cod_&lt;/b&gt;&lt;/span&gt;&quot;?&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;b&gt;SELECT&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;table_name,&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;b&gt;column_name&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;FROM&lt;/span&gt;&amp;nbsp;&lt;/b&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;&lt;b&gt;information_schema.columns&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;b&gt;WHERE&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;b&gt;column_name&lt;/b&gt;&lt;/span&gt;&amp;nbsp; LIKE&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4c1130; font-weight: bold;&quot;&gt;&#39;cod_%&#39;&lt;/span&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;b&gt;;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #4c1130;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
Ao executarmos a consulta acima, será retornado o resultado exibido na imagem abaixo:&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/AVvXsEiQFll0TycA3DEAqWRN9lPluslnxWUfS3IzT8D-yFj__yY4iERPlioZ538GF8lkPXcpzlr-uyhY5OGm6w2puiRDg7qf4pfBSgM1l4UmntYWm15OI_rI1TEL1ppK6y6yw3T0kKsajQ8X4u8/s1600/tabela_que_contenham_coluna_iniciadas_por_cod_.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;143&quot; data-original-width=&quot;268&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQFll0TycA3DEAqWRN9lPluslnxWUfS3IzT8D-yFj__yY4iERPlioZ538GF8lkPXcpzlr-uyhY5OGm6w2puiRDg7qf4pfBSgM1l4UmntYWm15OI_rI1TEL1ppK6y6yw3T0kKsajQ8X4u8/s1600/tabela_que_contenham_coluna_iniciadas_por_cod_.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
Logo existem colunas iniciadas por &quot;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;b&gt;cod_&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&quot; nas tabelas &quot;tb_ordem_servico&quot;, &quot;tb_municipio&quot; e &quot;tb_estado&quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;3º) Exemplo:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Além de procurar todas as tabelas que contenham colunas iniciadas por &quot;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;b&gt;cod_&lt;/b&gt;&lt;/span&gt;&quot;, vamos mostrar o tipo de dado de cada coluna.&lt;br /&gt;
&lt;br /&gt;
Para isso vamos incluir na consulta a coluna&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;data_type&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;b&gt;SELECT&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;table_name,&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;b&gt;column_name,&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;data_type&lt;/span&gt;&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;FROM&lt;/span&gt;&amp;nbsp;&lt;/b&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;&lt;b&gt;information_schema.columns&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;b&gt;WHERE&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;b&gt;column_name&lt;/b&gt;&lt;/span&gt;&amp;nbsp; LIKE&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4c1130;&quot;&gt;&lt;b&gt;&#39;cod_%&#39;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Ao executarmos a consulta acima, será retornado o resultado exibido na imagem abaixo:&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&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/AVvXsEjh4Deu09o_aY5KMMubUMSonuD7XXl5T2SLwme198QQuXj748oEDfUSBSEFaxPeoz_N2LLlUWVo9lo_xJj3uuFSeObZeJcViEQqBI35tQjGACHMjF7_p6kJPw3UU9n6N9UUjiguZg_yOBg/s1600/tabela_information_schema_colums_incluir_tipo_de_dado.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;141&quot; data-original-width=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjh4Deu09o_aY5KMMubUMSonuD7XXl5T2SLwme198QQuXj748oEDfUSBSEFaxPeoz_N2LLlUWVo9lo_xJj3uuFSeObZeJcViEQqBI35tQjGACHMjF7_p6kJPw3UU9n6N9UUjiguZg_yOBg/s1600/tabela_information_schema_colums_incluir_tipo_de_dado.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Observações finais:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Existem mais colunas na view &quot;&lt;b style=&quot;color: #274e13;&quot;&gt;columns&lt;/b&gt;&quot;, que podem ser utilizadas na sua consulta. Para visualizar todas, utilize &quot;*&quot;:&lt;br /&gt;
&lt;br /&gt;
&lt;b style=&quot;color: #274e13;&quot;&gt;SELECT&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;*&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;FROM&lt;/span&gt;&amp;nbsp;&lt;/b&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;&lt;b&gt;information_schema.columns&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
Para saber mais sobre o assunto acesse:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://www.postgresql.org/docs/9.3/static/infoschema-columns.html&quot;&gt;https://www.postgresql.org/docs/9.3/static/infoschema-columns.html&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://jquerydicas.blogspot.com/feeds/88927802771866899/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://jquerydicas.blogspot.com/2017/11/procurar-tabelas-que-contenham-uma.html#comment-form' title='1 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/88927802771866899'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/88927802771866899'/><link rel='alternate' type='text/html' href='http://jquerydicas.blogspot.com/2017/11/procurar-tabelas-que-contenham-uma.html' title='Procurar tabelas que contenham uma coluna com um nome especifico - Postgresql'/><author><name>Kelly</name><uri>http://www.blogger.com/profile/03449060135636479990</uri><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/AVvXsEhwcDF7s4NKkLhUmp8XW8hFmBrm7LOZj_NXzAX7FEBmrJamcx-AUpriE_nBFYHYv7O40RuEbPPyLUqkH0biVfFDxHrJByJ4Bx57E8QKYdEbXRcuKKwSs_cyldoWvJVd_xxTJg9m3zY0WxA/s72-c/catalogo_objetos_tabela_columns.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7010404629734647455.post-7947474552752147557</id><published>2017-11-03T08:44:00.001-02:00</published><updated>2017-11-03T18:36:18.960-02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Google Cloud VM"/><title type='text'>Google Cloud VM Debian - Instalação do Postgresql</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;1º)&lt;/b&gt; Clique na seta, para escolher um projeto.Veja a imagem abaixo:&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Caso não tenha VM Debian configurada, e tenha dúvida, veja o post:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: inherit;&quot;&gt;&lt;a href=&quot;http://jquerydicas.blogspot.com.br/2017/10/google-cloud-criar-maquina-virtual-vm.html&quot; target=&quot;_blank&quot;&gt;Google Cloud - Criar Máquina Virtual (VM) - Debian 9&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&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/AVvXsEjEhVd9cEUuDNg-D0auikceotn0CGlBVybQt4SdWoZAwbZS3bsUh162hBRBVggpkeC7PRwSbBULRMf64UVnaYIn4FRSbhjCm9Q-msTpD9F29Q3cvKHJhg5wwHt_OuA7M1mvO5-8nyByKdY/s1600/1+-+Escolher+um+projeto.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;454&quot; data-original-width=&quot;478&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEhVd9cEUuDNg-D0auikceotn0CGlBVybQt4SdWoZAwbZS3bsUh162hBRBVggpkeC7PRwSbBULRMf64UVnaYIn4FRSbhjCm9Q-msTpD9F29Q3cvKHJhg5wwHt_OuA7M1mvO5-8nyByKdY/s1600/1+-+Escolher+um+projeto.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;2º) &lt;/b&gt;Clique no link com o nome do projeto.&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/AVvXsEhhSHaMCyqbN1XD7oM8OGO899rjWcEIJIstE-neNt-muOmOrYVVp68uZosMn1rQtwQcqBpp1Kh70OGI-0S_nsz1U8B5kv6ISFvNEbLgehX9BOkeXJ3pH5Z09yPMHkvrubvcKiBn4JPv6fQ/s1600/2+-+Clique+no+link+com+o+nome+do+projeto.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;240&quot; data-original-width=&quot;559&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhSHaMCyqbN1XD7oM8OGO899rjWcEIJIstE-neNt-muOmOrYVVp68uZosMn1rQtwQcqBpp1Kh70OGI-0S_nsz1U8B5kv6ISFvNEbLgehX9BOkeXJ3pH5Z09yPMHkvrubvcKiBn4JPv6fQ/s1600/2+-+Clique+no+link+com+o+nome+do+projeto.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;3º) &lt;/b&gt;No menu escolha a opção &quot;Compute Engine&quot;, será aberto um submenu, escolha a opção &quot;Intâncias da VM&quot;:&lt;br /&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/AVvXsEjg4BgL4VREgzVHCeasP0n8TwxQg9M7_31FFeifXJ8Hxdgg1iFfpbi3gJq22eKiv82uqC_eeIBN7yaE84ghxjWtVsmd7sbm3A0P7YAHhpDSQ95v5EK06IuHpO3UuHLjH7ERcHhng1vzMrs/s1600/3+-+menu_maquina_virtual_vm.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;498&quot; data-original-width=&quot;449&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjg4BgL4VREgzVHCeasP0n8TwxQg9M7_31FFeifXJ8Hxdgg1iFfpbi3gJq22eKiv82uqC_eeIBN7yaE84ghxjWtVsmd7sbm3A0P7YAHhpDSQ95v5EK06IuHpO3UuHLjH7ERcHhng1vzMrs/s1600/3+-+menu_maquina_virtual_vm.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;4º) &lt;/b&gt;Conecte-se a sua VM Debian via SSH, neste exemplo,&amp;nbsp; a conexão será feita através do navegador.&lt;br /&gt;
&lt;br /&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: left;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNqJQPymy2aLRfa1vOpE5HyLWe9f0eQaSUa_zIYh98DyPHAWgBxsDQgY6rJBoIJK9OA_r6mFEjYwndfWaDL_WZ4C5DivxJMR52k8l1u0503rure_mpuHXR3TWouU2qcQmxC9TGdNe0G_o/s1600/4+-+Conectar+a+VM+DEBIAN+via+SSH.png&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; data-original-height=&quot;211&quot; data-original-width=&quot;572&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNqJQPymy2aLRfa1vOpE5HyLWe9f0eQaSUa_zIYh98DyPHAWgBxsDQgY6rJBoIJK9OA_r6mFEjYwndfWaDL_WZ4C5DivxJMR52k8l1u0503rure_mpuHXR3TWouU2qcQmxC9TGdNe0G_o/s1600/4+-+Conectar+a+VM+DEBIAN+via+SSH.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;5º) &lt;/b&gt;Conecte-se como usuário root (super-usuário) do Debian. Caso tenha dúvida, como configurar a senha de root na&amp;nbsp;&lt;span style=&quot;background-color: white; color: #222222; font-family: inherit;&quot;&gt;VM Debian, veja o artigo:&lt;/span&gt;&lt;br /&gt;
&lt;h3 class=&quot;post-title entry-title&quot; itemprop=&quot;name&quot; style=&quot;background-color: white; color: #222222; font-stretch: normal; font-weight: normal; line-height: normal; margin: 0.75em 0px 0px; position: relative; text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt;&lt;a href=&quot;http://jquerydicas.blogspot.com.br/2017/09/google-cloud-vm-senha-de-root-do-debian.html&quot; target=&quot;_blank&quot;&gt;Google Cloud VM - Senha de root do Debian&lt;/a&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;6º) &lt;/b&gt;Atualize os pacotes do Debian, antes de instalar o postgresql. Com o comando:&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;apt-get update&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
Veja a imagem abaixo:&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/AVvXsEjudrM6MGyqdsyT782XhV_XKT2_DIzjoZcz9jJxLXO_SpajnnrsNfw0ebJmeAuP7ITl9nI9r023EyPqO1fsiWC1lBAhdLGX28gTbVmLXiHtx2_gJ_3pZjUjgMfwEgWZMJqZRjcKMGisL20/s1600/6+-+atualizar+pacotes+do+Debian.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;81&quot; data-original-width=&quot;496&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjudrM6MGyqdsyT782XhV_XKT2_DIzjoZcz9jJxLXO_SpajnnrsNfw0ebJmeAuP7ITl9nI9r023EyPqO1fsiWC1lBAhdLGX28gTbVmLXiHtx2_gJ_3pZjUjgMfwEgWZMJqZRjcKMGisL20/s1600/6+-+atualizar+pacotes+do+Debian.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;7º)&lt;/b&gt; Agora instalaremos o Postgresql, o cliente do Postgresql (psql) e o pacote adicional &quot;postgresql-contrib&quot;, que contém comandos e funções que contribuirão para manipulação de dados.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #073763;&quot;&gt;apt-get &lt;/span&gt;&lt;span style=&quot;color: #4c1130;&quot;&gt;-y&lt;/span&gt;&lt;span style=&quot;color: #073763;&quot;&gt; install &lt;/span&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;postgresql &lt;/span&gt;&lt;span style=&quot;color: #4c1130;&quot;&gt;postgresql-client&lt;/span&gt;&lt;span style=&quot;color: #073763;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #660000;&quot;&gt;postgresql-contrib&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #073763; font-family: inherit;&quot;&gt;Legenda do comando:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li style=&quot;text-align: left;&quot;&gt;&lt;b style=&quot;color: #073763; text-align: center;&quot;&gt;apt-get install&lt;/b&gt;&lt;span style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;:&lt;b&gt;&amp;nbsp;&lt;/b&gt;comando de instalação;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;color: #4c1130;&quot;&gt;&lt;b&gt;-y&lt;/b&gt;: &lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;durante a instalação, deverá ser feita algumas confirmações, o &quot;-y&quot; significa &quot;yes&quot;, ou seja, &quot;sim&quot;, para a instalação não ficar tendo interrupções esperando uma confirmação do usuário, deixe como padrão sim, ela será executada do começo ao fim sem parar;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;color: #274e13; font-weight: bold;&quot;&gt;postgresql&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;: para instalar o postgresql;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;text-align: center;&quot;&gt;&lt;b&gt;postgresql-client:&lt;span style=&quot;font-weight: normal;&quot;&gt;&amp;nbsp;para instalar o cliente do Postgresql (psql), através do psql é possível executar querys e ver o resultado das mesmas;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #073763;&quot;&gt;&lt;b style=&quot;color: black;&quot;&gt;&lt;span style=&quot;color: #660000;&quot;&gt;postgresql-contrib&lt;/span&gt;&lt;/b&gt;:&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;contém comandos e funções que contribuirão para manipulação de dados;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Veja a imagem abaixo:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&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/AVvXsEiJX9vUYh2a65HsOb2ywNTXdW47Qy3sw9GDwrjaVDlx3c55cTB3hDMGzzRcbt6-uTPIYMuKOJBmksAYKu2tbTpXG_5ZBn8rj7Mh7vsish7eYX-XA-6rtgwX0MdYSbt707ctYAQg9_Esdng/s1600/7+-+instalar+postgresql.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;16&quot; data-original-width=&quot;523&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJX9vUYh2a65HsOb2ywNTXdW47Qy3sw9GDwrjaVDlx3c55cTB3hDMGzzRcbt6-uTPIYMuKOJBmksAYKu2tbTpXG_5ZBn8rj7Mh7vsish7eYX-XA-6rtgwX0MdYSbt707ctYAQg9_Esdng/s1600/7+-+instalar+postgresql.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;8º)&lt;/b&gt;&amp;nbsp;Execute o cliente do Postgresql, o psql, com o usuário postgres.&lt;br /&gt;
Será acessado o banco de dados padrão &quot;postgres&quot; (tanto o usuário quanto o banco tem o mesmo nome &quot;postgres&quot;).&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;sudo -u postgres psql postgres&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
Veja a imagem abaixo:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&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/AVvXsEjVSRaJ8kr5N9YMBVMzg7KrbbotcNEq3S6khlxzg6QdxYqk65Jg6dG4PW32te1aSRYqLuJv98i1J6XyaIQcFJlopQLylP_Fd-DOrpo_m9aE5Y-P6cbgfLuxo8e3zP5qK0HtAkIYbYb4SZQ/s1600/8+-+execute+o+cliente+do+postgresql+-+psql++-+com+o+usuario+postgres.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;16&quot; data-original-width=&quot;235&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVSRaJ8kr5N9YMBVMzg7KrbbotcNEq3S6khlxzg6QdxYqk65Jg6dG4PW32te1aSRYqLuJv98i1J6XyaIQcFJlopQLylP_Fd-DOrpo_m9aE5Y-P6cbgfLuxo8e3zP5qK0HtAkIYbYb4SZQ/s1600/8+-+execute+o+cliente+do+postgresql+-+psql++-+com+o+usuario+postgres.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;9º)&lt;/b&gt; Veja o psql em execução, na imagem abaixo:&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/AVvXsEiabWLhOzMShaErZHx5Yb56cSV5bVbu0-vLEBjBN__T2nvcQon6Hi8skPdfCs56g8AdwjgSdCijv3mOSCU4EZzARf2gnd6Me8lkOR-dfamd42ogTqhfoziexdISx8PkVrTVhodeAllAcLg/s1600/9+-+o+psql+est%25C3%25A1+em+execu%25C3%25A7%25C3%25A3o.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;68&quot; data-original-width=&quot;267&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiabWLhOzMShaErZHx5Yb56cSV5bVbu0-vLEBjBN__T2nvcQon6Hi8skPdfCs56g8AdwjgSdCijv3mOSCU4EZzARf2gnd6Me8lkOR-dfamd42ogTqhfoziexdISx8PkVrTVhodeAllAcLg/s1600/9+-+o+psql+est%25C3%25A1+em+execu%25C3%25A7%25C3%25A3o.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;10º)&lt;/b&gt; Configure a senha do usuário postgres, utilize o comando:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;\password postgres&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
Veja a imagem:&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/AVvXsEg0rPuExVOZ9DGC0C8TGJWUIlo62rGfNAVYkVvUNTeMAxcKFaX6HTFr9WH8X-JmsBhlsZW2-zEeC16zGYDY2DsZ7nCAGiDXnUkQaNeBk-8vT0AGfp4XL-x2Q1ARVW1qgy8x-4-4FrudGlE/s1600/10+-+configurar+uma+senha+para+o+usu%25C3%25A1rio+postgres.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;24&quot; data-original-width=&quot;227&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0rPuExVOZ9DGC0C8TGJWUIlo62rGfNAVYkVvUNTeMAxcKFaX6HTFr9WH8X-JmsBhlsZW2-zEeC16zGYDY2DsZ7nCAGiDXnUkQaNeBk-8vT0AGfp4XL-x2Q1ARVW1qgy8x-4-4FrudGlE/s1600/10+-+configurar+uma+senha+para+o+usu%25C3%25A1rio+postgres.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;11º)&lt;/b&gt; Digite a senha e a confirme.&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/AVvXsEiwrjjhpV91_AaHNEim_wMtl7OogJEP8JYh7kZs4d_LeGwfp3GyGrJOFaK5CTXUlxunuOzHeiwYXR5PHLYtSUqaoFwSdI7MJh29iBkxpcbzwv0en4VSDGlF6pIC16kcADsxnGuKF5UU4wQ/s1600/11+-+Digite+a+senha.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;66&quot; data-original-width=&quot;356&quot; height=&quot;59&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwrjjhpV91_AaHNEim_wMtl7OogJEP8JYh7kZs4d_LeGwfp3GyGrJOFaK5CTXUlxunuOzHeiwYXR5PHLYtSUqaoFwSdI7MJh29iBkxpcbzwv0en4VSDGlF6pIC16kcADsxnGuKF5UU4wQ/s320/11+-+Digite+a+senha.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;12º)&lt;/b&gt; Instale a extensão adminpack&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #073763;&quot;&gt;CREATE EXTENSION adminpack;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
Veja a imagem abaixo:&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/AVvXsEhgRHxXt2fhi_qVBtbCbvKhzsOhI6dNAgRVyUV7381wtKFSl7i9XAO7XDySijqiYBX5nv941dARc2GtV7ahyphenhyphenNH7725FQJNT2cNCXZj8M8N7tA1sbQrBQNqkwSMgmaS7KPLnwtvQ6tZzeyM/s1600/12+CREATE+EXTENSION+adminpack.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;18&quot; data-original-width=&quot;296&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgRHxXt2fhi_qVBtbCbvKhzsOhI6dNAgRVyUV7381wtKFSl7i9XAO7XDySijqiYBX5nv941dARc2GtV7ahyphenhyphenNH7725FQJNT2cNCXZj8M8N7tA1sbQrBQNqkwSMgmaS7KPLnwtvQ6tZzeyM/s1600/12+CREATE+EXTENSION+adminpack.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;b&gt;13º)&lt;/b&gt; Será exibida que a mensagem confirmando que a extensão foi criada.&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/AVvXsEgdhAkHuqlGJBN-UnGcUkc7oRG5fe-VGy6yyOyWWSX1j1Jl03HflhKu2ty2fU7xjnGGKnhXzXRKdq4HAnm6v1ZV9nTGq2sAaLYB4pxFvOb0QJPw90za2fUT4Rp2-IAz9EL2t2L9TDUsrEM/s1600/13+-+confirma%25C3%25A7%25C3%25A3o+de+cria%25C3%25A7%25C3%25A3o+de+extens%25C3%25A3o.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;16&quot; data-original-width=&quot;135&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdhAkHuqlGJBN-UnGcUkc7oRG5fe-VGy6yyOyWWSX1j1Jl03HflhKu2ty2fU7xjnGGKnhXzXRKdq4HAnm6v1ZV9nTGq2sAaLYB4pxFvOb0QJPw90za2fUT4Rp2-IAz9EL2t2L9TDUsrEM/s1600/13+-+confirma%25C3%25A7%25C3%25A3o+de+cria%25C3%25A7%25C3%25A3o+de+extens%25C3%25A3o.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;14º)&lt;/b&gt; O postgresql está instalado e psql já está executando.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;15º)&lt;/b&gt; Para sair do psql, utilize o comando:&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;\q&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
Veja a imagem abaixo:&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/AVvXsEibiPv4BwyOpa2iPOVRr8XVFdggc_lVfkgga7bps2th0T3cDH8U5iD68d6jBd9wx2lT-xXoB8r7Y8u2z4U9Jri0jmaGzl38zXZGn8QE1GqUUrv8ArptnZ3Kcdp0tOEp5MBipsEWsXLstKM/s1600/14+-+sair+do+psql.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;21&quot; data-original-width=&quot;105&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibiPv4BwyOpa2iPOVRr8XVFdggc_lVfkgga7bps2th0T3cDH8U5iD68d6jBd9wx2lT-xXoB8r7Y8u2z4U9Jri0jmaGzl38zXZGn8QE1GqUUrv8ArptnZ3Kcdp0tOEp5MBipsEWsXLstKM/s1600/14+-+sair+do+psql.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;b&gt;16º)&lt;/b&gt; Se você gostaria de saber mais sobre:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Configuração das conexões com o banco;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Configuração do firewall;&lt;/li&gt;
&lt;li&gt;Acessar o postgresql da sua máquina local, utilizando interface gráfica, como por exemplo, o PgAdmin&lt;/li&gt;
&lt;/ul&gt;
Leia o artigo:&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a href=&quot;http://jquerydicas.blogspot.com.br/2017/09/google-cloud-vm-debian-configuracao.html&quot; target=&quot;_blank&quot;&gt;Google Cloud VM Debian - Configuração para conexão remota no Postgresql&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jquerydicas.blogspot.com/feeds/7947474552752147557/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://jquerydicas.blogspot.com/2017/11/google-cloud-vm-debian-instalacao-do.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/7947474552752147557'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/7947474552752147557'/><link rel='alternate' type='text/html' href='http://jquerydicas.blogspot.com/2017/11/google-cloud-vm-debian-instalacao-do.html' title='Google Cloud VM Debian - Instalação do Postgresql'/><author><name>Kelly</name><uri>http://www.blogger.com/profile/03449060135636479990</uri><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/AVvXsEjEhVd9cEUuDNg-D0auikceotn0CGlBVybQt4SdWoZAwbZS3bsUh162hBRBVggpkeC7PRwSbBULRMf64UVnaYIn4FRSbhjCm9Q-msTpD9F29Q3cvKHJhg5wwHt_OuA7M1mvO5-8nyByKdY/s72-c/1+-+Escolher+um+projeto.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7010404629734647455.post-5574191293551841521</id><published>2017-10-29T18:27:00.002-02:00</published><updated>2017-11-05T14:32:49.372-02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Google Cloud VM"/><title type='text'>Google Cloud - Criar Máquina Virtual (VM) - Debian 9</title><content type='html'>&lt;b&gt;1º)&lt;/b&gt;&amp;nbsp;Clique na seta destacada em vermelho para criar um novo projeto.&amp;nbsp; &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/AVvXsEgGQF9jBS19u32WrFUNC_NXyhyExnhaoYlxsQGx50lYxs89HhlIyQlQvLPaFLy3L-xJYeLN-7Qet9o3JcUvtB_mCq6-1HvT6LsWQMBxfB9yUx8mcsmJvkyv_RYest30DVC7JVty_iho65I/s1600/1-+criar+uma+vm+no+google+cloud.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;399&quot; data-original-width=&quot;472&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGQF9jBS19u32WrFUNC_NXyhyExnhaoYlxsQGx50lYxs89HhlIyQlQvLPaFLy3L-xJYeLN-7Qet9o3JcUvtB_mCq6-1HvT6LsWQMBxfB9yUx8mcsmJvkyv_RYest30DVC7JVty_iho65I/s1600/1-+criar+uma+vm+no+google+cloud.png&quot; /&gt;&lt;/a&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;/div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;2º) &lt;/b&gt;Será aberta uma nova tela, na qual é possível pesquisar um projeto existente ou clicar no botão &quot;+&quot;, para criar um novo projeto, que é nosso caso.&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/AVvXsEiH_Za7kBHA7w_GPHvkN4UURKSoEHV2FoZMrADNs68DwM_16jJ3-BD4u0n2Mb9ulwhpg9vn6dVUE3U4zs1nR6tMK63gxUUUo7IUb9pFAkD5AJ-9GQuJ5OTYWeMlBgJxhI0ckMjU8nqFmXU/s1600/2+-+Clique+no+bot%25C3%25A3o+mais.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;204&quot; data-original-width=&quot;503&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiH_Za7kBHA7w_GPHvkN4UURKSoEHV2FoZMrADNs68DwM_16jJ3-BD4u0n2Mb9ulwhpg9vn6dVUE3U4zs1nR6tMK63gxUUUo7IUb9pFAkD5AJ-9GQuJ5OTYWeMlBgJxhI0ckMjU8nqFmXU/s1600/2+-+Clique+no+bot%25C3%25A3o+mais.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;3º) &lt;/b&gt;Neste exemplo, o&amp;nbsp;novo projeto será chamado &quot;projeto-teste-2&quot;. Após preencher o nome do seu projeto clique no botão &quot;Criar&quot;&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/AVvXsEgUo1PyNR3Sss2gQd6McsF-ZckLeTK7yz4kMGegT94ILUZtw5_Q86MU_Ty8yy2B6lOOTieGsI0RxrKn1pi_hd9Ef9lAWCnZTvxVdMhyphenhyphengAT0E_CDkYPnQja2D_m08BA974L6eA23abf4hhU/s1600/3+-++nomear+o+projeto+e+clicar+no+bot%25C3%25A3o+criar.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;298&quot; data-original-width=&quot;471&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUo1PyNR3Sss2gQd6McsF-ZckLeTK7yz4kMGegT94ILUZtw5_Q86MU_Ty8yy2B6lOOTieGsI0RxrKn1pi_hd9Ef9lAWCnZTvxVdMhyphenhyphengAT0E_CDkYPnQja2D_m08BA974L6eA23abf4hhU/s1600/3+-++nomear+o+projeto+e+clicar+no+bot%25C3%25A3o+criar.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;4º) &lt;/b&gt;Clique no botão &quot;Criar&quot; para criar uma nova Instância da VM.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAtmIZc1blc_7TQUCrHoSOXTM9QxyN2a1nFnphn1NRRT71NHU-8Rkx0risKRjtyhAC2unWcOf6aV-VXdLyDHOkuAHTwH98Q3BzOOG60vcSp7HwILE77i5rWppIg99_Ly0d6XYoticjVyM/s1600/4+-+Clique+no+bot%25C3%25A3o+criar+-++para+uma+nova+m%25C3%25A1quina+virtual.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 0em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;442&quot; data-original-width=&quot;574&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAtmIZc1blc_7TQUCrHoSOXTM9QxyN2a1nFnphn1NRRT71NHU-8Rkx0risKRjtyhAC2unWcOf6aV-VXdLyDHOkuAHTwH98Q3BzOOG60vcSp7HwILE77i5rWppIg99_Ly0d6XYoticjVyM/s1600/4+-+Clique+no+bot%25C3%25A3o+criar+-++para+uma+nova+m%25C3%25A1quina+virtual.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;5º) &lt;/b&gt;Será aberto um formulário de criação da VM,&amp;nbsp; a seguir serão preenchidos os campos básicos para o funcionamento da VM:&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/AVvXsEioGbpJIcNyIvZfN_KPkCsw1IqfJDAJBlMt_LRrkTBnqR0LkM4_YB0YAlqB-w7qJ7P5D9hBfCBCdck5evnVtdjZX9c_V5BJIbUIkhVIyowRQu2rfGcS-w5m5zPNelRnW5IU-YZmKsgXJoY/s1600/5+-+tela+de+cria%25C3%25A7%25C3%25A3o+de+instancia.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;439&quot; data-original-width=&quot;448&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioGbpJIcNyIvZfN_KPkCsw1IqfJDAJBlMt_LRrkTBnqR0LkM4_YB0YAlqB-w7qJ7P5D9hBfCBCdck5evnVtdjZX9c_V5BJIbUIkhVIyowRQu2rfGcS-w5m5zPNelRnW5IU-YZmKsgXJoY/s1600/5+-+tela+de+cria%25C3%25A7%25C3%25A3o+de+instancia.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;6º) &lt;/b&gt;Preencha o nome do campo.&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/AVvXsEjiu3Lc58zUKibUDsE7D0D369KdG6rxJ-QD13USRl_MLIuis8kebsvI5dWldT9pNJDouDS218gEZT93QryCoFCnKEqyeZV_TLMv4J3ZHl5L64OfqyeVrwUBzWQz3TGC2hivRI4ZLXkCNE8/s1600/6+-+Preencher+o+nome+da+inst%25C3%25A2ncia.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;66&quot; data-original-width=&quot;471&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiu3Lc58zUKibUDsE7D0D369KdG6rxJ-QD13USRl_MLIuis8kebsvI5dWldT9pNJDouDS218gEZT93QryCoFCnKEqyeZV_TLMv4J3ZHl5L64OfqyeVrwUBzWQz3TGC2hivRI4ZLXkCNE8/s1600/6+-+Preencher+o+nome+da+inst%25C3%25A2ncia.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;b&gt;7º) &lt;/b&gt;Preencha o nome da zona.&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/AVvXsEgZacJMWouTAOOWdVxjcF1grbv_IsD6zQE4xUYBl5ZmXju9ecNzlZpZ1WXO-rZ5zRSYDo9FNSM3TBYHumzAiUh63tD4qslOsJKAgww5vox2AyMU6cG7Aux5OlHjRpL_sAWzaMZDg3diZ7Y/s1600/7+-+Preencher+o++campo+zona.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;124&quot; data-original-width=&quot;472&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZacJMWouTAOOWdVxjcF1grbv_IsD6zQE4xUYBl5ZmXju9ecNzlZpZ1WXO-rZ5zRSYDo9FNSM3TBYHumzAiUh63tD4qslOsJKAgww5vox2AyMU6cG7Aux5OlHjRpL_sAWzaMZDg3diZ7Y/s1600/7+-+Preencher+o++campo+zona.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
Para saber mais sobre as localidades que serão hospedados seus dados, veja:&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;span style=&quot;color: #1155cc; font-family: &amp;quot;arial&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;a href=&quot;https://cloud.google.com/compute/docs/regions-zones/regions-zones?hl=pt_BR&amp;amp;_ga=2.227979677.-1618039993.1498426005#available&quot; style=&quot;text-decoration-line: none;&quot;&gt;https://cloud.google.com/compute/docs/regions-zones/regions-zones?hl=pt_BR&amp;amp;_ga=2.227979677.-1618039993.1498426005#available&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;8º) &lt;/b&gt;Preencha o tipo máquina. O tipo de máquina é a configuração da sua máquina, ou seja processador, memória e disco (hd). O preço varia de acordo com a máquina escolhida. Neste exemplo, escolhemos uma das mais simples a &quot;SMALL&quot;, mas há várias configurações de acordo com a sua necessidade.&lt;br /&gt;
&lt;br /&gt;
O tipo e o tamanho de hd será escolhido no 9º passo.&lt;br /&gt;
&lt;br /&gt;
Repare que o valor estimado mensalmente, é exibido do lado direito. Estimado, porque o valor é cobrado por hora em que a instância, está &quot;ativa&quot;,&amp;nbsp; caso você não use está máquina continuamente durante o mês, é possível desativá-la, e quando precisar reative, novamente, e pague somente as horas utilizadas durante o mês.&lt;br /&gt;
&lt;br /&gt;
Atualmente, o google está com uma promoção que oferece R$ 300,00 de crédito para novos usuários do CLOUD. Esses créditos expiram após um ano. Caso o crédito acabe antes de um ano, será necessário, efetuar o pagamento para continuar utilizando o serviço, caso tenha interesse.&lt;br /&gt;
&lt;br /&gt;
Particularmente, estou utilizando o serviço a praticamente 3 meses, e estou gostando bastante.&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;/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/AVvXsEhSvZdBBI_eq1CtC6jfJhkyuzpQh34EtN4rmbzwYxY96y62onsqXNQWUIX1Q_zm3uOo_2Xkbx6U8FJ-inTRCUZsqmFkKaAbq1BCv8-BibCXh74BhoT0M8ynRZnWrQ1fku46p82sjejIdeo/s1600/8+-+tipo+de+maquina.png&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; data-original-height=&quot;392&quot; data-original-width=&quot;577&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSvZdBBI_eq1CtC6jfJhkyuzpQh34EtN4rmbzwYxY96y62onsqXNQWUIX1Q_zm3uOo_2Xkbx6U8FJ-inTRCUZsqmFkKaAbq1BCv8-BibCXh74BhoT0M8ynRZnWrQ1fku46p82sjejIdeo/s1600/8+-+tipo+de+maquina.png&quot; /&gt;&lt;/a&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: left;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;9º) &lt;/b&gt;Agora vamos escolher a imagem do sistema operacional, neste exemplo, vamos escolher o DEBIAN, mas há centenas de imagens disponíveis no Cloud, entre elas as distribuições Linux: Ubuntu, CentOs, Red Hat.&lt;br /&gt;
Também está disponível imagens para o sistema operacional Windows.&lt;br /&gt;
&lt;br /&gt;
A seguir escolha o tipo do disco &quot;convencional&quot; ou SSD (este disco tem maior velocidade de acesso).&lt;br /&gt;
&lt;br /&gt;
Preencha o tamanho do disco, por padrão vem configurado com 10 GB, mas você poderá aumentar a capacidade.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUoZYehiy9yOFj9-LCx04Gvt14rCc4uqCQh-d6CR_m2-092q0mW6sx9F5TtHmsHbyRXWsAjziFk5qnJV3U7VrqFJq0ZeNKtciKVFNKH0FZ9Ekod5L4MnX-fOYAnCZc997W_CaeSI3082Q/s1600/9+-++imagem+vm+-+tipo+e+tamanho+do+disco.png&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; data-original-height=&quot;591&quot; data-original-width=&quot;578&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUoZYehiy9yOFj9-LCx04Gvt14rCc4uqCQh-d6CR_m2-092q0mW6sx9F5TtHmsHbyRXWsAjziFk5qnJV3U7VrqFJq0ZeNKtciKVFNKH0FZ9Ekod5L4MnX-fOYAnCZc997W_CaeSI3082Q/s1600/9+-++imagem+vm+-+tipo+e+tamanho+do+disco.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;10º) &lt;/b&gt;Se você quer criar, um servidor web, você pode liberar:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;o tráfego HTTP, na porta 80;&lt;/li&gt;
&lt;li&gt;o tráfego HTTPS, para conexões seguras, na porta 443;&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&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/AVvXsEiQXoFEvd4etrl3tt2AjJYvbgsVDFy7nJZtJ50YlB3_LZH63Ali-umFe430bjR6E5BwfrcbTpNNk6iKaUTKPtTo9rIARiKYITxx2wbcKMf3yghMveSh1GlDJkM176xx2XzVS8QQci7CVRw/s1600/10-++vm+-+liberar+http+e+ou+https.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;158&quot; data-original-width=&quot;556&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQXoFEvd4etrl3tt2AjJYvbgsVDFy7nJZtJ50YlB3_LZH63Ali-umFe430bjR6E5BwfrcbTpNNk6iKaUTKPtTo9rIARiKYITxx2wbcKMf3yghMveSh1GlDJkM176xx2XzVS8QQci7CVRw/s1600/10-++vm+-+liberar+http+e+ou+https.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;11º) &lt;/b&gt;Clique no link &quot;Redes&quot; para configurar um IP estático (fixo).&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&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/AVvXsEiLzKEhxBLib9s0EhcrTfeP_wQYk5wJlf4l8zbmkluMKhxxTy0KqvFhhm0rm12ENDQCZLKi-7gTOGrG01vGcijcg5OLTWxudzhyphenhyphenokaIFMErBDOAFsgG5BGQankJEhu0AsqCCNGa8SUGMYk/s1600/11+-+Clique+no+link+redes+para+configurar+uma+ip+est%25C3%25A1tico+-+fixo.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;116&quot; data-original-width=&quot;550&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLzKEhxBLib9s0EhcrTfeP_wQYk5wJlf4l8zbmkluMKhxxTy0KqvFhhm0rm12ENDQCZLKi-7gTOGrG01vGcijcg5OLTWxudzhyphenhyphenokaIFMErBDOAFsgG5BGQankJEhu0AsqCCNGa8SUGMYk/s1600/11+-+Clique+no+link+redes+para+configurar+uma+ip+est%25C3%25A1tico+-+fixo.png&quot; /&gt;&lt;/a&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: left;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;12º) &lt;/b&gt;Preencha o campo &quot;Nome&quot;, a seguir clique no botão &quot;Reservar&quot;. Quando a instância estiver criada, será exibido um ip para a nova instância, neste exemplo foi o&amp;nbsp;35.185.28.193&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&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/AVvXsEjxVf5NrC2FkKsmdX7hceR8Fr98Fd-npRd0qfSngAe5OdbS5tU_el55vuCOzp_hGmVXWRP1RVQccLv1cdtgddX2GZtw9I0OAInJEZDUQj0-W_pXv1P7IcyouscuchUXKLUnWw6TJ8Qt9S8/s1600/12+-+reservar+ip+est%25C3%25A1tico+-+fixo.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;264&quot; data-original-width=&quot;504&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxVf5NrC2FkKsmdX7hceR8Fr98Fd-npRd0qfSngAe5OdbS5tU_el55vuCOzp_hGmVXWRP1RVQccLv1cdtgddX2GZtw9I0OAInJEZDUQj0-W_pXv1P7IcyouscuchUXKLUnWw6TJ8Qt9S8/s1600/12+-+reservar+ip+est%25C3%25A1tico+-+fixo.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;13º) &lt;/b&gt;Clique no botão &quot;Criar&quot; para a criação da instância.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&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/AVvXsEg9uov4uF61z7xsIN8E4ZqLe_ZVGeivitSnxgrFoXLNmDcetyo-6nBKYdSf2XPdnNP6Q7BEjamiEn55ee9r0mINWWsSslmhVtYbqdFE7N4-IeD21VQc3QuP4h_vCVeWbwlbC5MPx6w0Q88/s1600/13+-+Clicar+no+bot%25C3%25A3o+criar.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;122&quot; data-original-width=&quot;337&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9uov4uF61z7xsIN8E4ZqLe_ZVGeivitSnxgrFoXLNmDcetyo-6nBKYdSf2XPdnNP6Q7BEjamiEn55ee9r0mINWWsSslmhVtYbqdFE7N4-IeD21VQc3QuP4h_vCVeWbwlbC5MPx6w0Q88/s1600/13+-+Clicar+no+bot%25C3%25A3o+criar.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;14º) &lt;/b&gt;Aguarde a criação da instância.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtfwnQ9HgHII-beGyC-wpPuTpLEDsLqbgSeeTQAtVuBERk4C0XTmud7vTiOKlOst7U82Pun5C2lmQs1Lw2DJ_-OmOtG7rabSH9EVL2FcHIZEZZA4h5X4-F3OcShGNMUeQBgigAAsw9m1k/s1600/14+-+Aguarde+a+cria%25C3%25A7%25C3%25A3o+da+inst%25C3%25A2ncia.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;370&quot; data-original-width=&quot;571&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtfwnQ9HgHII-beGyC-wpPuTpLEDsLqbgSeeTQAtVuBERk4C0XTmud7vTiOKlOst7U82Pun5C2lmQs1Lw2DJ_-OmOtG7rabSH9EVL2FcHIZEZZA4h5X4-F3OcShGNMUeQBgigAAsw9m1k/s1600/14+-+Aguarde+a+cria%25C3%25A7%25C3%25A3o+da+inst%25C3%25A2ncia.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;15º) &lt;/b&gt;Quando a instância estiver criada, aparecerá um ícone verde, indicando que a instância está pronta. Você já pode utilizar sua máquina virtual (VM) Debian 9.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&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/AVvXsEgU3jBscqSk6e6XQePnxjPXROQiHgljRqOr5iIiV1d647fwdQ_ZXTTK-ikGGEzfHZtBuPcipEdpfvUJ22MvWzew3v319QDlGD6vmCrGVPbKXGJUFsADhcs3NluR9i1ndKsne1_gCKw9VZo/s1600/15++-+instacia_pronta_para_uso.png&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; data-original-height=&quot;183&quot; data-original-width=&quot;574&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgU3jBscqSk6e6XQePnxjPXROQiHgljRqOr5iIiV1d647fwdQ_ZXTTK-ikGGEzfHZtBuPcipEdpfvUJ22MvWzew3v319QDlGD6vmCrGVPbKXGJUFsADhcs3NluR9i1ndKsne1_gCKw9VZo/s1600/15++-+instacia_pronta_para_uso.png&quot; /&gt;&lt;/a&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;/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: left;&quot;&gt;
&lt;b&gt;16º) &lt;/b&gt;Há algumas maneira para se conectar a VM via SSH. A mais simples é e escolher a opção &quot;Abrir na janela do navegador&quot;. Será aberta uma nova janela no navegador, onde você visulizará sua nova VM Debian.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Também é possível se conectar no terminal do linux, usando o comando SSH ou no windows através do PUTTY (cliente SSH,&amp;nbsp; para utilizá-lo é necessário fazer o download e instalar, é gratuito).&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Para saber mais sobre conexão SSH no Google Cloud, veja:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span id=&quot;docs-internal-guid-ca7152b7-69a4-fdfb-dc2f-f4300a90630d&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;a href=&quot;https://cloud.google.com/compute/docs/instances/connecting-to-instance#standardssh&quot;&gt;https://cloud.google.com/compute/docs/instances/connecting-to-instance#standardssh&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&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;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&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/AVvXsEiLu6LdhugTeq0pcVsJd7W599abXFoksmN2W1zLgwKXui_GbPRtlsmG2agV4BuSPHl4XY40hXlcCH9ctO9J7PkGxXlLpSaewDgCAwXiuBpza05QXo6dHDYPiSutzYzeo98ubNkA3FhpLi0/s1600/16+-+se+conectar+ao+ssh+e+abrir+janela+no+navegador.png&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; data-original-height=&quot;228&quot; data-original-width=&quot;581&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLu6LdhugTeq0pcVsJd7W599abXFoksmN2W1zLgwKXui_GbPRtlsmG2agV4BuSPHl4XY40hXlcCH9ctO9J7PkGxXlLpSaewDgCAwXiuBpza05QXo6dHDYPiSutzYzeo98ubNkA3FhpLi0/s1600/16+-+se+conectar+ao+ssh+e+abrir+janela+no+navegador.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;17º) &lt;/b&gt;Veja a seguir, a sua nova Máquina Virtual (VM), exibida no navegador.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjr6URVV1qlu1I87tO1ZZi122SqM3sRluGh6I7z0E5NPYhH7rsESZ0Lob5_7yfrpO4wktTC_Pz5whNjCUf39n2vo8P3Sa3sGr9Kg6TkGXVed9ISlsvvU0VWRBDzKwJhCkK6h8UgIZoI_Jw/s1600/17+-+imagem+da+instancia+do+navegador.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 0em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;267&quot; data-original-width=&quot;585&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjr6URVV1qlu1I87tO1ZZi122SqM3sRluGh6I7z0E5NPYhH7rsESZ0Lob5_7yfrpO4wktTC_Pz5whNjCUf39n2vo8P3Sa3sGr9Kg6TkGXVed9ISlsvvU0VWRBDzKwJhCkK6h8UgIZoI_Jw/s1600/17+-+imagem+da+instancia+do+navegador.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Se você já está com sua estância criada mas precisar aumentar o tamanho do disco&amp;nbsp;&amp;nbsp;e / ou&amp;nbsp;a quantidade de memória é muito simples, basta apenas acessar uma estância clicar em editar e alterar os valores de disco e / ou memória e depois salvar as alterações&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Para se autenticar no Debian 9, veja o artigo:&lt;/div&gt;
&lt;h3 class=&quot;post-title entry-title&quot; itemprop=&quot;name&quot; style=&quot;background-color: white; color: #222222; font-stretch: normal; font-weight: normal; line-height: normal; margin: 0.75em 0px 0px; position: relative;&quot;&gt;
&lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt;&lt;a href=&quot;http://jquerydicas.blogspot.com.br/2017/09/google-cloud-vm-senha-de-root-do-debian.html&quot; target=&quot;_blank&quot;&gt;Google Cloud VM - Senha de root do Debian&lt;/a&gt;&lt;/span&gt;&lt;/h3&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: left;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jquerydicas.blogspot.com/feeds/5574191293551841521/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://jquerydicas.blogspot.com/2017/10/google-cloud-criar-maquina-virtual-vm.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/5574191293551841521'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/5574191293551841521'/><link rel='alternate' type='text/html' href='http://jquerydicas.blogspot.com/2017/10/google-cloud-criar-maquina-virtual-vm.html' title='Google Cloud - Criar Máquina Virtual (VM) - Debian 9'/><author><name>Kelly</name><uri>http://www.blogger.com/profile/03449060135636479990</uri><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/AVvXsEgGQF9jBS19u32WrFUNC_NXyhyExnhaoYlxsQGx50lYxs89HhlIyQlQvLPaFLy3L-xJYeLN-7Qet9o3JcUvtB_mCq6-1HvT6LsWQMBxfB9yUx8mcsmJvkyv_RYest30DVC7JVty_iho65I/s72-c/1-+criar+uma+vm+no+google+cloud.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7010404629734647455.post-441911554394799071</id><published>2017-09-24T14:22:00.004-03:00</published><updated>2017-11-05T09:54:33.218-02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Google Cloud VM"/><title type='text'>Google Cloud VM Debian - Configuração para conexão remota no Postgresql</title><content type='html'>&lt;br /&gt;
Neste post, descrevemos como se conectar remotamente no Postgresql, utilizando o Google Cloud VM Debian.&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;b&gt;1º) &amp;nbsp;&lt;/b&gt;Acessar a instância da VM através do menu: Compute Engine =&amp;gt; Instâncias da VM&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/AVvXsEhpLLDr3nk75LdXmbGrVpLtlE1dap35HEN74JgkAru6U_vmEZp6U7Pkx797Ag1aqnVImqdtDNq97rmv4E13vzU7LqaehzA8wyF9PuwA-WyKP568iGAIglBhEF4MVraHaG7fClgPWkNqXo4/s1600/compute_engine_intancia_vm.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;404&quot; data-original-width=&quot;481&quot; height=&quot;268&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpLLDr3nk75LdXmbGrVpLtlE1dap35HEN74JgkAru6U_vmEZp6U7Pkx797Ag1aqnVImqdtDNq97rmv4E13vzU7LqaehzA8wyF9PuwA-WyKP568iGAIglBhEF4MVraHaG7fClgPWkNqXo4/s320/compute_engine_intancia_vm.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;2º)&lt;/b&gt;&amp;nbsp;Escolha a instância em que está instalado o Debian e se conecte via SSH. Veja a imagem abaixo:&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/AVvXsEigKH5NwreNj3jguBrxMsvfS10u4mJPuTturtgl4cKznq9CbiWMC_yenRCf2C46tIdEXUmBLk8n8MjNjJ5HC1pGauSVJXmSI7XSfGuBVoT7LvUZhPH8Gs6xtJ_EOn8G3AIAEuyW8PrfZtE/s1600/conexao_cliente_ssh.png&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; data-original-height=&quot;162&quot; data-original-width=&quot;584&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigKH5NwreNj3jguBrxMsvfS10u4mJPuTturtgl4cKznq9CbiWMC_yenRCf2C46tIdEXUmBLk8n8MjNjJ5HC1pGauSVJXmSI7XSfGuBVoT7LvUZhPH8Gs6xtJ_EOn8G3AIAEuyW8PrfZtE/s1600/conexao_cliente_ssh.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;3º)&lt;/b&gt;&amp;nbsp;Será aberto o terminal, em seguida, faça a autenticação no debian, como root. Para se autenticar utilizar, utilize o comando:&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;su&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Veja a imagem abaixo:&lt;/div&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgj-16MU0wR9Fr19Oi3biufMpGhP9XPI6IuIdUt6JHSqBMb_xgde_ruj2LFaiZnxAfotpmXYqqE0WnJ8hotyuxTSLfx7p_USxfAHVKUE5Zu9YtMl3NLn8lYI1drdHII6Jh76uKCiGyH_d4/s1600/00+-+autenticacao+root+debian.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;50&quot; data-original-width=&quot;571&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgj-16MU0wR9Fr19Oi3biufMpGhP9XPI6IuIdUt6JHSqBMb_xgde_ruj2LFaiZnxAfotpmXYqqE0WnJ8hotyuxTSLfx7p_USxfAHVKUE5Zu9YtMl3NLn8lYI1drdHII6Jh76uKCiGyH_d4/s1600/00+-+autenticacao+root+debian.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Autenticação &amp;nbsp;no Debian&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;4º)&lt;/b&gt; Se autenticar no cliente psql, neste caso foi feita a autenticação com o usuário &quot;postgres&quot; e o banco de dados &quot;postgres&quot;, utilize o comando:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;sudo -u&lt;/span&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #4c1130;&quot;&gt;nome_usuario&lt;/span&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #444444;&quot;&gt;psql&lt;/span&gt;&lt;span style=&quot;color: #274e13;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4c1130;&quot;&gt;nome_banco&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;sudo -u&lt;/span&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #4c1130;&quot;&gt;postgres &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #444444;&quot;&gt;psql&lt;/span&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;color: #4c1130;&quot;&gt;postgres&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
Veja a imagem abaixo:&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/AVvXsEhIunijYXyQYzIbA23adfUwNb4QGMvjCqrzSOn-yEZ0dv1DWAF4hE8R9nBk3k8D2uTzlIcUiLE5kk6L4leJF5eTZ7K0eApwCnlxz-NkqANhdcy94OKE5T1sfENG-ymLy3PrLTMiBXQMd3Y/s1600/01+-+autenticacao+postgresql.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;51&quot; data-original-width=&quot;452&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIunijYXyQYzIbA23adfUwNb4QGMvjCqrzSOn-yEZ0dv1DWAF4hE8R9nBk3k8D2uTzlIcUiLE5kk6L4leJF5eTZ7K0eApwCnlxz-NkqANhdcy94OKE5T1sfENG-ymLy3PrLTMiBXQMd3Y/s1600/01+-+autenticacao+postgresql.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;5º)&lt;/b&gt; Localize o diretório onde se encontra o arquivo &quot;pg_hba.conf&quot;. Utilize o comando:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;SHOW hba_file&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;Veja a imagem:&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&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/AVvXsEg6sjVe8RJNIFfQL254h_xlF0qAXBZZbgQqueUfFA_KsSYNRgKRRpLfqXEd6VcJRgw_AMZkEEKapKPoNmsW1k-bNJi4Z10lqEF0fgvi29EN6Ki_-mvo-ah2IrJHsKJGL1K-6DktJYGg0u0/s1600/02+-+localizar_pg_hba_conf_no_linux.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;75&quot; data-original-width=&quot;302&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6sjVe8RJNIFfQL254h_xlF0qAXBZZbgQqueUfFA_KsSYNRgKRRpLfqXEd6VcJRgw_AMZkEEKapKPoNmsW1k-bNJi4Z10lqEF0fgvi29EN6Ki_-mvo-ah2IrJHsKJGL1K-6DktJYGg0u0/s1600/02+-+localizar_pg_hba_conf_no_linux.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;6º)&lt;/b&gt; Localize o diretório onde se encontra o arquivo &quot;postgresql.conf&quot;. Utilize&amp;nbsp;o comando:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;SHOW config_file&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;Veja a imagem:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&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;/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/AVvXsEiraJdp3vUdNVJPzYw0J6yytTwA31BNEpKGEBO0jXXPtOB2nhl1GdsR4YyGz-Q6AmLRLUIw3bKP5Z8SLkEiQeLReZ8mUBeYtwCC8dXlveFdHyWKWWm6iTwOuYXtGJps2sz9m4IwmEiCdvI/s1600/03+-+localizar_postgresql_conf_no_linux.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;83&quot; data-original-width=&quot;352&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiraJdp3vUdNVJPzYw0J6yytTwA31BNEpKGEBO0jXXPtOB2nhl1GdsR4YyGz-Q6AmLRLUIw3bKP5Z8SLkEiQeLReZ8mUBeYtwCC8dXlveFdHyWKWWm6iTwOuYXtGJps2sz9m4IwmEiCdvI/s1600/03+-+localizar_postgresql_conf_no_linux.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;7º)&lt;/b&gt; Saia do cliente psql. Veja&amp;nbsp;o comando:&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #073763;&quot;&gt;\q&lt;/span&gt;&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/AVvXsEhvCa-TOsAVfs5OF4qieSCUVrD4xVZqKlDQQ8jWM8a7MPHr2GA4X54UwURScMtSSB34CivWYGh65dYfkprgp-FuRNUsbdKhRC_PTb4R-0PIOkuZ29H5txlfVIijCfjXwtTalGbVL4AYQEA/s1600/06+-+sair_cliente_psq.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;25&quot; data-original-width=&quot;120&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvCa-TOsAVfs5OF4qieSCUVrD4xVZqKlDQQ8jWM8a7MPHr2GA4X54UwURScMtSSB34CivWYGh65dYfkprgp-FuRNUsbdKhRC_PTb4R-0PIOkuZ29H5txlfVIijCfjXwtTalGbVL4AYQEA/s1600/06+-+sair_cliente_psq.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;b&gt;8º)&lt;/b&gt;&amp;nbsp;Após localizar o diretório do arquivo &quot;pg_hba.conf&quot;, vamos editá-lo. Podemos utilizar um editor de texto. Exemplo: &quot;nano&quot; ou &quot;vi&quot;.&lt;br /&gt;
Neste, exemplo será utilizado o &quot;nano&quot;. Utilize o comando abaixo:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;nano&lt;/b&gt;&lt;/span&gt;&lt;b&gt; &lt;span style=&quot;color: #274e13;&quot;&gt;/etc/postgresql/9.6/main/pg_hba.conf&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Veja a imagem abaixo:&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&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/AVvXsEgOWEkdw0kaQrJOOa7gvAzp1rZsHm4E8TAGl27CU_EdUlYDqHj8e5NDmn8Zwo9a-yn4sVsr1ssXqQieBuxKLt7LmUP-nJk1wowx90s-n_5naHpcsh5DkXnu8qsl9myeNIWlpNmBHcBfWxI/s1600/05+-+editar_pg_hba_conf.png&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; data-original-height=&quot;19&quot; data-original-width=&quot;588&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOWEkdw0kaQrJOOa7gvAzp1rZsHm4E8TAGl27CU_EdUlYDqHj8e5NDmn8Zwo9a-yn4sVsr1ssXqQieBuxKLt7LmUP-nJk1wowx90s-n_5naHpcsh5DkXnu8qsl9myeNIWlpNmBHcBfWxI/s1600/05+-+editar_pg_hba_conf.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;b&gt;9º)&lt;/b&gt;&amp;nbsp;No arquivo &quot;pg_hba.conf&quot;, localize &quot;127.0.0.1/32&quot;, ou seja, o ip 127.0.0.1 e mascara 32.&lt;br /&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/AVvXsEiuBpFTg3O4-Ct8GvLKNCdMf0530t0_cBCAJJiW6OhlqoK_Hc3nR2brZsCa5yKlTckQ6R2INuUh59bbIttXLGcKri4jEYUQBsafsZ3nFMOBhq4H78LfstS34TUsx5TYNE9iAIdHHJ_mQKQ/s1600/07+-+nano_pg_hba_alterar_ip_local.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;456&quot; data-original-width=&quot;555&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuBpFTg3O4-Ct8GvLKNCdMf0530t0_cBCAJJiW6OhlqoK_Hc3nR2brZsCa5yKlTckQ6R2INuUh59bbIttXLGcKri4jEYUQBsafsZ3nFMOBhq4H78LfstS34TUsx5TYNE9iAIdHHJ_mQKQ/s1600/07+-+nano_pg_hba_alterar_ip_local.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
Após localizar o IP, nós vamos substituí-lo de acordo com o tipo de conexão desejada:&lt;br /&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;/div&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Para aceitar conexão de qualquer ip&lt;/b&gt;: &amp;nbsp;substitua o ip &amp;nbsp;&lt;b&gt;127.0.0.1/32&lt;/b&gt; pelo ip &lt;b&gt;0.0.0.0/0&lt;/b&gt;. Para fechar o editor &quot;Nano&quot;, pressione as teclas &quot;&lt;b&gt;CTRL+X&quot;&lt;/b&gt;. Em seguida, será exibida uma pergunta confirmando se você deseja salvar, pressione a tecla &quot;y&lt;b&gt;&quot; &lt;/b&gt;para salvar&lt;b&gt;&amp;nbsp;&lt;/b&gt;ou a tecla &quot;n&quot; para desistir das alterações&lt;b&gt;.&amp;nbsp;&lt;/b&gt;&amp;nbsp;Veja a imagem a seguir:&lt;/li&gt;
&lt;/ul&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/AVvXsEji9GHBxOXKGINUvaSKTi9yV6XhEIfKbwFVgdJfK2-FQFmtIGSe64bjU6BI9uRo1vhV71-k2jANtsiJ8Y7mx8RIESLJhtRJTV0pY1O4z5Cl4dcXlVMmx0-HZJUztKq4nMfbVf7Y82p-T9g/s1600/08+-+nano_pg_hba_alterar_ip_local_aceita_conexao_de+qualquer_ip.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;453&quot; data-original-width=&quot;559&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEji9GHBxOXKGINUvaSKTi9yV6XhEIfKbwFVgdJfK2-FQFmtIGSe64bjU6BI9uRo1vhV71-k2jANtsiJ8Y7mx8RIESLJhtRJTV0pY1O4z5Cl4dcXlVMmx0-HZJUztKq4nMfbVf7Y82p-T9g/s1600/08+-+nano_pg_hba_alterar_ip_local_aceita_conexao_de+qualquer_ip.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Para restringir a conexão a uma determinada faixa de ips&lt;/b&gt;: substitua o ip &lt;b&gt;127.0.0.1&lt;/b&gt;&amp;nbsp;pelo ip &lt;b&gt;&lt;i&gt;desejado&lt;/i&gt;&lt;/b&gt;, neste exemplo foi utilizado o ip &lt;b&gt;192.168.64.2/24&lt;/b&gt;, poderia ser um outro ip. &amp;nbsp;Para sair do editor &quot;Nano&quot;, pressione as teclas &quot;&lt;b&gt;CTRL+X&quot;&lt;/b&gt;. Em seguida, será exibida uma pergunta, confirmando se você deseja salvar, pressione a tecla &quot;y&lt;b&gt;&quot; &lt;/b&gt;ou a tecla &quot;n&quot; para desistir das alterações&lt;b&gt;.&amp;nbsp;&lt;/b&gt;Veja a imagem a seguir:&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;&lt;/ul&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/AVvXsEgRqZqK5JrZYN_MTpbBnXKwTNQyYAGBb274cB7PZxhVkNRMrxg0hqzon0YN77rMoRBxGLPYF4dXQz4CEbh899gkh3bpvVAdsBpwB3yBlyXnLkzVcQsdqHZMA6i_eeu2RzW6R5Z6N7M3WOI/s1600/08+-+nano_pg_hba_alterar_ip_local_restringir_conexao_faixa_ips.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;357&quot; data-original-width=&quot;561&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRqZqK5JrZYN_MTpbBnXKwTNQyYAGBb274cB7PZxhVkNRMrxg0hqzon0YN77rMoRBxGLPYF4dXQz4CEbh899gkh3bpvVAdsBpwB3yBlyXnLkzVcQsdqHZMA6i_eeu2RzW6R5Z6N7M3WOI/s1600/08+-+nano_pg_hba_alterar_ip_local_restringir_conexao_faixa_ips.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;10º)&lt;/b&gt;&amp;nbsp;Após localizar o diretório do arquivo &quot;postgresql.conf&quot;, vamos editá-lo.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;nano&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&amp;nbsp;&lt;span style=&quot;color: #274e13;&quot;&gt;/etc/postgresql/9.6/main/postgresql.conf&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Veja a imagem abaixo:&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&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/AVvXsEgl0LAzBrpBhrlqWogPfcW_LpoqY0C7thGJLSX1nzBiAciK5NIjpT71xmcKYCLl7-TYF0acmYnSUMbXTubGjE3ZLOrz_DvZGP68Fz33eh6hV8pbt2tWYKZSg59JVSoYnF1q9INPdAKaWZU/s1600/06+-+editar_postgresql_conf.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;20&quot; data-original-width=&quot;567&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgl0LAzBrpBhrlqWogPfcW_LpoqY0C7thGJLSX1nzBiAciK5NIjpT71xmcKYCLl7-TYF0acmYnSUMbXTubGjE3ZLOrz_DvZGP68Fz33eh6hV8pbt2tWYKZSg59JVSoYnF1q9INPdAKaWZU/s1600/06+-+editar_postgresql_conf.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;b&gt;11º)&lt;/b&gt;&amp;nbsp;No &amp;nbsp;arquivo &quot;postgresql.conf&quot;, localize o item &lt;span style=&quot;color: #20124d; font-weight: bold;&quot;&gt;listen_adressess&lt;/span&gt;. Veja a imagem abaixo:&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/AVvXsEjUOGVfr-iVuupvCGXup-QdVfnB8utQ9IG55fi991F7b1A17GXUbboJudP7jKltmbsTPPJSjjdXJCcNnwppgxVu3-r4_LXFKV1S-HilL0ZvNjOYVH9wp_aUSWTLrLD2YUAJLOnHm5sgnJA/s1600/08+-+postgresql_conf_alterar_opcao_listen_adresses_localhost.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;406&quot; data-original-width=&quot;586&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUOGVfr-iVuupvCGXup-QdVfnB8utQ9IG55fi991F7b1A17GXUbboJudP7jKltmbsTPPJSjjdXJCcNnwppgxVu3-r4_LXFKV1S-HilL0ZvNjOYVH9wp_aUSWTLrLD2YUAJLOnHm5sgnJA/s1600/08+-+postgresql_conf_alterar_opcao_listen_adresses_localhost.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;b&gt;12º)&lt;/b&gt;&amp;nbsp;&amp;nbsp;Remova o comentário do item, &lt;b&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;l&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;&lt;b&gt;isten_adressess&lt;/b&gt;, representados pelo&amp;nbsp;&lt;/span&gt;&quot;#&quot;. Em seguida, substitua, &#39;&lt;b&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;localhost&lt;/span&gt;&lt;/b&gt;&#39;, por &#39;&lt;b&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;*&lt;/span&gt;&lt;/b&gt;&#39;. Para sair do editor &quot;Nano&quot;, pressione as teclas &quot;&lt;b&gt;CTRL+X&quot;&lt;/b&gt;. Em seguida, será exibida uma pergunta, confirmando se você deseja salvar, pressione a tecla &quot;y&lt;b&gt;&quot;&amp;nbsp;&lt;/b&gt;ou a tecla &quot;n&quot; para desistir das alterações&lt;b&gt;.&amp;nbsp;&lt;/b&gt;Veja a imagem a seguir:&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/AVvXsEg5p7SOK7_e_QuanBe4cdRbK0srfsokJ9zsvA_Ho8Czh6l4Gnl5C9uWo8nC99J9pvugRrMFnUT40FVk60Alax-W5lQ-0gDIfvj94HdLV9SG4hSe7hDLojOXOwRzi6d3l-uVY2nuLTq2u-k/s1600/09+-+postgresql_conf_alterar_opcao_listen_adressess_asterisco.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;287&quot; data-original-width=&quot;547&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5p7SOK7_e_QuanBe4cdRbK0srfsokJ9zsvA_Ho8Czh6l4Gnl5C9uWo8nC99J9pvugRrMFnUT40FVk60Alax-W5lQ-0gDIfvj94HdLV9SG4hSe7hDLojOXOwRzi6d3l-uVY2nuLTq2u-k/s1600/09+-+postgresql_conf_alterar_opcao_listen_adressess_asterisco.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b style=&quot;color: #20124d;&quot;&gt;13º) &lt;/b&gt;Escolher a quantidade de conexões, no padrão de instalação, o máximo são 100 conexões. O número de conexões é armazenado no parâmetro &quot;max_connections&quot;.&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&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;/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/AVvXsEii1uutYzojqzsXoUFTr4TfiIV-KyC-sXatAlMNAzX1e6ayG11lbn5u_yoJkf3IdwVhoDLxAF-vS1yVF14Oj2V9aqH_ALcs97EGBTKxVTTQyy_bRPGcDQAU6C9v3WXU44NvI41gWgjJRQU/s1600/alterar+o+numero+de+conexoes+padrao.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;205&quot; data-original-width=&quot;551&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEii1uutYzojqzsXoUFTr4TfiIV-KyC-sXatAlMNAzX1e6ayG11lbn5u_yoJkf3IdwVhoDLxAF-vS1yVF14Oj2V9aqH_ALcs97EGBTKxVTTQyy_bRPGcDQAU6C9v3WXU44NvI41gWgjJRQU/s1600/alterar+o+numero+de+conexoes+padrao.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
Neste exemplo, vamos alterar o número de conexões 100 para 120.&lt;br /&gt;
&lt;br /&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;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&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/AVvXsEijshqMdTOW3Yn6xh-Y-O4fdXGPdG_qucOkcU5XVSD-Wy53I5vGmUTiwr01leaO6gp1TCAPePSplIlFAtvRbDpki3rlPMx1v669BT_XqBG4c1mXZoR0qM6N-SpYMXT8sCDNrEmdbG0VU4s/s1600/mudar+o+numero+de+conexoes.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;206&quot; data-original-width=&quot;535&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijshqMdTOW3Yn6xh-Y-O4fdXGPdG_qucOkcU5XVSD-Wy53I5vGmUTiwr01leaO6gp1TCAPePSplIlFAtvRbDpki3rlPMx1v669BT_XqBG4c1mXZoR0qM6N-SpYMXT8sCDNrEmdbG0VU4s/s1600/mudar+o+numero+de+conexoes.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;b&gt;14º) &lt;/b&gt;Alterar o parâmetro, &quot;shared_buffers&quot;, que determina quanta memória é dedicada para o Postgresql para o caching de dados. Por padrão, está configurado com 128 MB.&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/AVvXsEh_fvj3XiSdM9PllNB2enLmVmmDNi8wVHC_XIN6znm6v8mBd5OrioPX4lJB6vR7RFL8GR_y6r6hCyWf9W5_z0VIFu_w7qpU-6WH8MslcAH91_GCTgKOh1H1ezFHmeU22NAOtcm9RdlNung/s1600/shared_buffers_valor_padrao.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;121&quot; data-original-width=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_fvj3XiSdM9PllNB2enLmVmmDNi8wVHC_XIN6znm6v8mBd5OrioPX4lJB6vR7RFL8GR_y6r6hCyWf9W5_z0VIFu_w7qpU-6WH8MslcAH91_GCTgKOh1H1ezFHmeU22NAOtcm9RdlNung/s1600/shared_buffers_valor_padrao.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
Se o seu sistema tem 1GB ou mais de RAM, o parametro &quot;shared_buffer&quot; deve estar configurado para utilizar 25% da memoria total. Neste exemplo, o sistema possui 2 GB, então vamos utilizar 512 MB para o parâmetro, shared buffer.&lt;br /&gt;
&lt;br /&gt;
Se o seu sistema possui menos de 1GB de RAM, você deve utilizar aproximadamente 15% da sua memória RAM.&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/AVvXsEiaSKsIwNL7SFxJOvQIcVBYT5NmwcwzYH4e9n3MiVmwf8pghvAnDxkhNpkCXCIdQzVCMgz_XOxwMpATgHikMzsevxecM7azEXo-N2k683S7bkNtjl9wjtDDeV6FU5L9Uo830ribTrmVQYU/s1600/shared_buffers_valor_alterado.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;115&quot; data-original-width=&quot;401&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaSKsIwNL7SFxJOvQIcVBYT5NmwcwzYH4e9n3MiVmwf8pghvAnDxkhNpkCXCIdQzVCMgz_XOxwMpATgHikMzsevxecM7azEXo-N2k683S7bkNtjl9wjtDDeV6FU5L9Uo830ribTrmVQYU/s1600/shared_buffers_valor_alterado.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;15º) &lt;/b&gt;Reinicie o serviço do postgresql&lt;br /&gt;
&lt;pre style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; font-size: 14px; font-stretch: normal; line-height: 20px; margin-bottom: 16px; margin-top: 16px; overflow: auto; padding: 8px; position: relative; text-align: center;&quot;&gt;&lt;code style=&quot;background: 0px center; box-sizing: inherit; font-stretch: normal; line-height: 1; padding: 0px; word-break: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #0c343d; font-family: inherit;&quot;&gt;sudo &lt;/span&gt;&lt;span style=&quot;color: #073763; font-family: inherit;&quot;&gt;service postgresql restart&lt;/span&gt;&lt;/b&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;16º) &amp;nbsp;&lt;/b&gt;No Google Cloud VM, vamos clicar no item de menu &quot;Regras de firewall&quot;. Veja a imagem abaixo:&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/AVvXsEiwVTAj5GmY6qU1bA4KSeLl4_etxxa884mIWx8-2wUCXUNaw0KOCENnoEu9V_yKQNjC4Wkj6UCDi6hdwtRU4thNG3YZZJOKfYZBc7cs_4bV_Kd9WLuW9A-4t8oaNZEbvBaBnAzkUpAu9Sw/s1600/Rede+VPC.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;544&quot; data-original-width=&quot;448&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwVTAj5GmY6qU1bA4KSeLl4_etxxa884mIWx8-2wUCXUNaw0KOCENnoEu9V_yKQNjC4Wkj6UCDi6hdwtRU4thNG3YZZJOKfYZBc7cs_4bV_Kd9WLuW9A-4t8oaNZEbvBaBnAzkUpAu9Sw/s1600/Rede+VPC.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;17º) &amp;nbsp;&lt;/b&gt;Em seguida clique no link &quot;Criar Regra de Firewall&quot;, no topo da pagina.&lt;br /&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/AVvXsEiz8wqtDGGzgA_lFGW0vIeO3rQR_tpIW7RDzIKOfTtB3OZ_V2kpYJgXIDe1nYmgXt4rs9DR_NYHpT2xSAfMEshXdgDQx-rnCgz2tmHu49bBWxARiALa1cSrZ8roOJL8Tq5n2sSBa06o3Mc/s1600/Criar+Regra+de+Firewall.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;404&quot; data-original-width=&quot;566&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiz8wqtDGGzgA_lFGW0vIeO3rQR_tpIW7RDzIKOfTtB3OZ_V2kpYJgXIDe1nYmgXt4rs9DR_NYHpT2xSAfMEshXdgDQx-rnCgz2tmHu49bBWxARiALa1cSrZ8roOJL8Tq5n2sSBa06o3Mc/s1600/Criar+Regra+de+Firewall.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;18º) &amp;nbsp;&lt;/b&gt;Será aberto o formulário, através do qual poderemos liberar a porta padrão 5432 do Postgresql, ou uma outra porta, conforme sua necessidade.&lt;br /&gt;
&lt;br /&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/AVvXsEh0eYy-Gy-xfh1-2AyHfb0kOpSOwp-0x55ATqWIXvTPjy8vVj8vIx-91OsUnRJHAPH5TW0QpyZkP_mLOF0ZRnXb8T9gyfVBZHF1HyArTwszbs6Ncv0J8y_rnYFnFDWWSutvBtasvUpHvwo/s1600/10+-+Regras+de+Firewall.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;452&quot; data-original-width=&quot;509&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0eYy-Gy-xfh1-2AyHfb0kOpSOwp-0x55ATqWIXvTPjy8vVj8vIx-91OsUnRJHAPH5TW0QpyZkP_mLOF0ZRnXb8T9gyfVBZHF1HyArTwszbs6Ncv0J8y_rnYFnFDWWSutvBtasvUpHvwo/s1600/10+-+Regras+de+Firewall.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;19º) &lt;/b&gt;Deverão ser preenchidos os seguintes campos:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Campo nome:&lt;/li&gt;
&lt;/ul&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/AVvXsEgXkeFw-_ZiSGeJKTqtvguO6LtEF2ef0KR9hLkkVyR_gN991nJBtp-TkOm3fG5KHX-8vhwVTQ3c2DGZEX2tUhTfMXcMKaQ9V4jSlnUn0iHWPpAsKR4ZESZoEnD8Z8mQxBN-pF6sQvMfF-g/s1600/14+-+campo_nome.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;76&quot; data-original-width=&quot;469&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXkeFw-_ZiSGeJKTqtvguO6LtEF2ef0KR9hLkkVyR_gN991nJBtp-TkOm3fG5KHX-8vhwVTQ3c2DGZEX2tUhTfMXcMKaQ9V4jSlnUn0iHWPpAsKR4ZESZoEnD8Z8mQxBN-pF6sQvMfF-g/s1600/14+-+campo_nome.png&quot; /&gt;&lt;/a&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: left;&quot;&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Preencha a tag e um IP:&lt;/li&gt;
&lt;/ul&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;/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;/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/AVvXsEijap87LteiEsCxjaP3CePRoeBsnNLQqUfAdW83LvzPfAytahWQKz3Y_Y95cpjCwrnuC-__b_0apx1MfnviLaMo354Va0YbJ-xtwspsKq268ibmlYhPqpB-Sqj9Ki3KTgaaFEs7cMparCU/s1600/ip+e+tag.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;248&quot; data-original-width=&quot;551&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijap87LteiEsCxjaP3CePRoeBsnNLQqUfAdW83LvzPfAytahWQKz3Y_Y95cpjCwrnuC-__b_0apx1MfnviLaMo354Va0YbJ-xtwspsKq268ibmlYhPqpB-Sqj9Ki3KTgaaFEs7cMparCU/s1600/ip+e+tag.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Preencha o protocolo e a porta&lt;/b&gt;: repare que devemos separar o protocolo e a porta com &quot;:&quot;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;b&gt;protocolo:porta&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&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/AVvXsEi_AechcWRzcPnXWr3ZT-78YCrJPo49zNIr1WpqGA98ePRqCBdTCdIWM3PAg2oSx0GabnRqeZ_c-hLIttExH56jRVSNyZk-DJ7zgnyir6FL3VQIjl6qcVw3cOYyxEDwxV3YndtZgZphZ1I/s1600/13+-+postgresql_porta.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;154&quot; data-original-width=&quot;467&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_AechcWRzcPnXWr3ZT-78YCrJPo49zNIr1WpqGA98ePRqCBdTCdIWM3PAg2oSx0GabnRqeZ_c-hLIttExH56jRVSNyZk-DJ7zgnyir6FL3VQIjl6qcVw3cOYyxEDwxV3YndtZgZphZ1I/s1600/13+-+postgresql_porta.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Clique no botão salvar&lt;/li&gt;
&lt;/ul&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/AVvXsEhKxpGiLxnKuMLYJQS9jDmdgjTjN-4aYfWJT7kj3cZhckq5Av1pKzZLJLEpN6WYX7v8xzwEONApzuNZXYl33y7e6P3s6fpsqSCbY74Cf2urcGLnU3bE1oom6dnhDAWYOZcI4BkJQ5qoXrE/s1600/botao+salvar.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;31&quot; data-original-width=&quot;57&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKxpGiLxnKuMLYJQS9jDmdgjTjN-4aYfWJT7kj3cZhckq5Av1pKzZLJLEpN6WYX7v8xzwEONApzuNZXYl33y7e6P3s6fpsqSCbY74Cf2urcGLnU3bE1oom6dnhDAWYOZcI4BkJQ5qoXrE/s1600/botao+salvar.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;20º)&lt;/b&gt;&amp;nbsp;Agora vamos acessar a instância&amp;nbsp;da VM através do menu:&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
Compute Engine =&amp;gt; Instâncias da VM&lt;/div&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/AVvXsEgtBxWdBn1XGfdfGitk4mEPQrHS3Cy6PCeeJoPlCYWmY7OxrCOqAp413I6i4o3oSrojWS-PKQaGY4sTX5MoIsg9IuXmuNsd-ibu10qQ7n9Dspp7TEBUtZBvMtM4EEXHJl_o0uzhpvfxc9Y/s1600/compute_engine_intancia_vm.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;404&quot; data-original-width=&quot;481&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtBxWdBn1XGfdfGitk4mEPQrHS3Cy6PCeeJoPlCYWmY7OxrCOqAp413I6i4o3oSrojWS-PKQaGY4sTX5MoIsg9IuXmuNsd-ibu10qQ7n9Dspp7TEBUtZBvMtM4EEXHJl_o0uzhpvfxc9Y/s1600/compute_engine_intancia_vm.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;21&lt;/b&gt;&lt;b&gt;º)&lt;/b&gt;&amp;nbsp;Clique na instância &quot;DEBIAN&quot;. Veja a imagem abaixo:&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/AVvXsEgHULhGJF46Zixg7LDZ-Xa9r41XrOnScXO03cy02fKQPzdCzGvlhZgObw0_hxqko2i6TyGKO17dkAw4xzcXyRiVrXxamTFSFrKcyZgUPeXeju4I4li7gA0hevoIBQItNid8nEMh06y1W3Q/s1600/inst%25C3%25A2ncia_debian.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;123&quot; data-original-width=&quot;356&quot; height=&quot;110&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHULhGJF46Zixg7LDZ-Xa9r41XrOnScXO03cy02fKQPzdCzGvlhZgObw0_hxqko2i6TyGKO17dkAw4xzcXyRiVrXxamTFSFrKcyZgUPeXeju4I4li7gA0hevoIBQItNid8nEMh06y1W3Q/s320/inst%25C3%25A2ncia_debian.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;22&lt;/b&gt;&lt;b&gt;º)&lt;/b&gt;&amp;nbsp;Clique em &quot;Editar&quot;instância. Veja a imagem abaixo:&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/AVvXsEiNGBZg6o-Zw5nI4n5TCZ7g4QIUDRvbfvaBWkUMS_btJdIBXI2RjBf31JNfPGVlG4QdeVoI-O7I-7KoBy35_-MLNRCbfsxWMWZHhy0vfTPgfQTD7Nby3ZrMd-AYj51aGLIYjhUp8CxRmwQ/s1600/Editar.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;446&quot; data-original-width=&quot;461&quot; height=&quot;309&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNGBZg6o-Zw5nI4n5TCZ7g4QIUDRvbfvaBWkUMS_btJdIBXI2RjBf31JNfPGVlG4QdeVoI-O7I-7KoBy35_-MLNRCbfsxWMWZHhy0vfTPgfQTD7Nby3ZrMd-AYj51aGLIYjhUp8CxRmwQ/s320/Editar.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;23&lt;/b&gt;&lt;b&gt;º)&lt;/b&gt;&amp;nbsp;No campo &quot;Tags de rede&quot;, &amp;nbsp;adicionar a tag &quot;pg&quot;, esta tag foi incluída na regra do firewall (15º passo). Ver imagem abaixo:&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/AVvXsEjjMdtOQfESrw75oOd7D1v5Fc0BjlRyMf5oE8HJoNApJyCKoVDG3WPMaRrUmbVb1qI6qUjs6HnirX7GbO5iXJ2-xhEwqEQN1Vn7mU9zYBejsW-7rCz6pLMHQyd1wKiSQFYOWxDeVc9lP1s/s1600/Incluir_tag_de_rede_na_inst%25C3%25A2ncia.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;367&quot; data-original-width=&quot;470&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjMdtOQfESrw75oOd7D1v5Fc0BjlRyMf5oE8HJoNApJyCKoVDG3WPMaRrUmbVb1qI6qUjs6HnirX7GbO5iXJ2-xhEwqEQN1Vn7mU9zYBejsW-7rCz6pLMHQyd1wKiSQFYOWxDeVc9lP1s/s1600/Incluir_tag_de_rede_na_inst%25C3%25A2ncia.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;b&gt;24º)&lt;/b&gt;&amp;nbsp;Clique no botão &quot;Salvar&quot;. Ver imagem abaixo:&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/AVvXsEjEMFEsIRRjjmVgTQR_EppczgPrTsS4UkVYrQWbXPZv48mKQl44bAC6MDkBTL-pGIflRvcd8EmKIG5lHc2zD1DMpORQgKYSoZj-k0yQX1Etl5UD7NL_NqH8uIUNVuqCt3YEsyH1tIZrHMI/s1600/botao+salvar.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;31&quot; data-original-width=&quot;57&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEMFEsIRRjjmVgTQR_EppczgPrTsS4UkVYrQWbXPZv48mKQl44bAC6MDkBTL-pGIflRvcd8EmKIG5lHc2zD1DMpORQgKYSoZj-k0yQX1Etl5UD7NL_NqH8uIUNVuqCt3YEsyH1tIZrHMI/s1600/botao+salvar.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;25º)&lt;/b&gt;&amp;nbsp;Clique no link &amp;nbsp;no formato de &quot;seta&quot;. para voltar a visualizar página inicial. Ver imagem abaixo:&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/AVvXsEj_pJMi0_rhO8q9EJaLgo-ltULEGJNprlqNgLvFTuqOaNybahnFGiaT3kPzw7Kd60Mt1Mqp411R9xBN3sSS9w0oTF-Q-QKYsZTXsVi4U_lTE-UEiSLYOrBEPiwx8I-TtfjkhCJAo48Ji8o/s1600/clicar_link_seta.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;367&quot; data-original-width=&quot;437&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_pJMi0_rhO8q9EJaLgo-ltULEGJNprlqNgLvFTuqOaNybahnFGiaT3kPzw7Kd60Mt1Mqp411R9xBN3sSS9w0oTF-Q-QKYsZTXsVi4U_lTE-UEiSLYOrBEPiwx8I-TtfjkhCJAo48Ji8o/s1600/clicar_link_seta.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;26º)&lt;/b&gt;&amp;nbsp;Observe na página inicial, o ip externo da sua estância, neste caso é o ip &lt;b&gt;35.202.119.38 &lt;/b&gt;que será utilizado para fazer a conexão remota.&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/AVvXsEhB56UnSZEMOPmk4vUsEWrN8VLvHxcccVawgRid4-16XgHEchflXGi7W_f_JSZIEHWtzb07TvAP1H8ZP5-a7eQYctFViLqdY3eblPaYnftSZLngFs4yQQevOXywbAcO6VYfT15I0xOX8zM/s1600/ip_externo.png&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; data-original-height=&quot;44&quot; data-original-width=&quot;577&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhB56UnSZEMOPmk4vUsEWrN8VLvHxcccVawgRid4-16XgHEchflXGi7W_f_JSZIEHWtzb07TvAP1H8ZP5-a7eQYctFViLqdY3eblPaYnftSZLngFs4yQQevOXywbAcO6VYfT15I0xOX8zM/s1600/ip_externo.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;b&gt;27º)&lt;/b&gt; Agora, após a finalização da configuração da VM, será feita a conexão remota. Vamos utilizar o &lt;b&gt;PgAdmin &lt;/b&gt;para efetuar a conexão.&lt;br /&gt;
Primeiramente, clique com o botão direito em &quot;Server&quot;, selecione o menu &quot;Create&quot;, em seguida, selecione o submenu &quot;Server&quot;.&lt;br /&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/AVvXsEg6MPUp_4HEM2NEDPA5IO7ovCK2nwAi_DIygRIu__kFPcLI-K6tacetKafCnXvLq3Cgo1AReJrBNX0M-PjgnGWd1p9kk-hgCcVto22mcj70RM_fqO0xRdUOcRw4xhyXuQy0phfEkWRlaAo/s1600/pg_admin_conectar_servidor_remoto.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;198&quot; data-original-width=&quot;521&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6MPUp_4HEM2NEDPA5IO7ovCK2nwAi_DIygRIu__kFPcLI-K6tacetKafCnXvLq3Cgo1AReJrBNX0M-PjgnGWd1p9kk-hgCcVto22mcj70RM_fqO0xRdUOcRw4xhyXuQy0phfEkWRlaAo/s1600/pg_admin_conectar_servidor_remoto.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;28º)&lt;/b&gt;&amp;nbsp;Será exibido um formulário. Vamos preencher alguns campos da aba &quot;General&quot; e da aba &quot;Connection&quot; com as configurações do servidor:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Aba General&lt;/b&gt;: vamos escolher um nome para a conexão remota, neste exemplo eu escolhi &quot;REM&quot;, mas poderia ser qualquer outro nome.&lt;/li&gt;
&lt;/ul&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/AVvXsEjACOp0b8CaEn08UfDwi5wMIC91vBmUM2quZlCB2FVN2Gv0s3VCR3EV7XW5CcBEMQF0dBjSjDgmmz-XQmXyDDSX6kpMqubOHO28BC8b8CJeTVbFFGuGGwZklHSs9EQKW1vfKFRD5L6Rt7g/s1600/aba_general_nome_host.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;561&quot; data-original-width=&quot;511&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjACOp0b8CaEn08UfDwi5wMIC91vBmUM2quZlCB2FVN2Gv0s3VCR3EV7XW5CcBEMQF0dBjSjDgmmz-XQmXyDDSX6kpMqubOHO28BC8b8CJeTVbFFGuGGwZklHSs9EQKW1vfKFRD5L6Rt7g/s1600/aba_general_nome_host.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Aba Connection&lt;/b&gt;: preencha o ip, a porta, o &amp;nbsp;nome do banco, o usuário e a senha, em seguida clique no botão &quot;Salvar&quot;. Veja a imagem abaixo:&lt;/li&gt;
&lt;/ul&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/AVvXsEhDskVNtQ3Ar03WSFCu8y0OFc8GdQ_p4cGRAADAP5HIgEmKb6hxa7H4jRyzwA2v8311LfaqJLmxYjBlml3a4wNnXGW8DvI-asFI6Y84DVQ9NoI8DEDeBjoO5X6NjhznAJoR_MocXwqNu6U/s1600/aba_connection.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;563&quot; data-original-width=&quot;505&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDskVNtQ3Ar03WSFCu8y0OFc8GdQ_p4cGRAADAP5HIgEmKb6hxa7H4jRyzwA2v8311LfaqJLmxYjBlml3a4wNnXGW8DvI-asFI6Y84DVQ9NoI8DEDeBjoO5X6NjhznAJoR_MocXwqNu6U/s1600/aba_connection.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;29º)&lt;/b&gt; A conexão remota foi efetuada com sucesso. Veja imagem abaixo:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&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/AVvXsEhqmV1-uaUOOW8Kvqi1Y36n4Zl9Xg4nJYMsBxRwNXnfVhz0TVdxhmZz3KIX0ch37ii3gjDwN8pPsizpqIfdGdX1yMLjEvS32O4ZMWULg5nq1nJjg7jTVzSJX9x42roXPjtMaxoJO-uLeLQ/s1600/conexao_efetuada_com_sucesso+.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;250&quot; data-original-width=&quot;305&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqmV1-uaUOOW8Kvqi1Y36n4Zl9Xg4nJYMsBxRwNXnfVhz0TVdxhmZz3KIX0ch37ii3gjDwN8pPsizpqIfdGdX1yMLjEvS32O4ZMWULg5nq1nJjg7jTVzSJX9x42roXPjtMaxoJO-uLeLQ/s1600/conexao_efetuada_com_sucesso+.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&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&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jquerydicas.blogspot.com/feeds/441911554394799071/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://jquerydicas.blogspot.com/2017/09/google-cloud-vm-debian-configuracao.html#comment-form' title='4 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/441911554394799071'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/441911554394799071'/><link rel='alternate' type='text/html' href='http://jquerydicas.blogspot.com/2017/09/google-cloud-vm-debian-configuracao.html' title='Google Cloud VM Debian - Configuração para conexão remota no Postgresql'/><author><name>Kelly</name><uri>http://www.blogger.com/profile/03449060135636479990</uri><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/AVvXsEhpLLDr3nk75LdXmbGrVpLtlE1dap35HEN74JgkAru6U_vmEZp6U7Pkx797Ag1aqnVImqdtDNq97rmv4E13vzU7LqaehzA8wyF9PuwA-WyKP568iGAIglBhEF4MVraHaG7fClgPWkNqXo4/s72-c/compute_engine_intancia_vm.png" height="72" width="72"/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7010404629734647455.post-8741253210581238729</id><published>2017-09-16T15:16:00.000-03:00</published><updated>2017-11-03T18:35:22.857-02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Google Cloud VM"/><category scheme="http://www.blogger.com/atom/ns#" term="Google Cloud VM - Password root"/><category scheme="http://www.blogger.com/atom/ns#" term="Google Cloud VM - Senha de root do Debian"/><title type='text'>Google Cloud VM - Senha de root do Debian</title><content type='html'>A senha de root (super usuário ou administrador) do Debian, no &lt;a href=&quot;https://console.cloud.google.com/&quot; target=&quot;_blank&quot;&gt;Google Cloud VM&lt;/a&gt;, &amp;nbsp;não está configurada por padrão.&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;ol&gt;
&lt;li style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Para alterar a senha, digite o comando:&amp;nbsp;&lt;/b&gt;&lt;b style=&quot;color: #351c75;&quot;&gt;&amp;nbsp;&lt;/b&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;sudo passwd root&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Digite a senha&lt;/b&gt;&lt;/li&gt;
&lt;li style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Confirme a senha&lt;/b&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Veja a imagem abaixo:
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1aFczchjWIm0WpK3EGne_XKMhohvOBR7QSPWKjs921b5vSQW5Dr9UAqC8J2KlSRz8RFOzCmWAIfSdg2vFj192xQkju45SXBfodVp2fUKV-7N-DWrViymkoJi_0KqO3oJi0r-6cziVafQ/s1600/google_cloud_mudar_senha_root_debian.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;61&quot; data-original-width=&quot;534&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1aFczchjWIm0WpK3EGne_XKMhohvOBR7QSPWKjs921b5vSQW5Dr9UAqC8J2KlSRz8RFOzCmWAIfSdg2vFj192xQkju45SXBfodVp2fUKV-7N-DWrViymkoJi_0KqO3oJi0r-6cziVafQ/s1600/google_cloud_mudar_senha_root_debian.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Google Cloud VM - Senha de root do Debian&lt;br /&gt;
&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
Após ter alterado a senha, faça a autenticação como usuário root.&lt;br /&gt;
Utilize o comando:&amp;nbsp;&lt;b style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;su&lt;/span&gt;&lt;/b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Veja a imagem abaixo:&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqWWiOOtQqQ6YR3Xo4CVjaZXeTHYs5YJMuKrhXK7E-UX3Kq_1nfl2AlLwqCrm3tPg4pts0fAxeIGpnz4RcS73g4d8Q9Olggfqm3iZ_O10V_-tCanHgBTsO1PhoNNINFhvk8sp8AUgIbgs/s1600/autenticacao+root+debian.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;50&quot; data-original-width=&quot;571&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqWWiOOtQqQ6YR3Xo4CVjaZXeTHYs5YJMuKrhXK7E-UX3Kq_1nfl2AlLwqCrm3tPg4pts0fAxeIGpnz4RcS73g4d8Q9Olggfqm3iZ_O10V_-tCanHgBTsO1PhoNNINFhvk8sp8AUgIbgs/s1600/autenticacao+root+debian.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Autenticação como root no Debian&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;b style=&quot;color: #741b47;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b style=&quot;color: #741b47;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Deixe o seu comentário ou sugestão.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;b&gt;Gostou?&amp;nbsp; Siga no Google + ou Facebook&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;b&gt;.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://jquerydicas.blogspot.com/feeds/8741253210581238729/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://jquerydicas.blogspot.com/2017/09/google-cloud-vm-senha-de-root-do-debian.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/8741253210581238729'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/8741253210581238729'/><link rel='alternate' type='text/html' href='http://jquerydicas.blogspot.com/2017/09/google-cloud-vm-senha-de-root-do-debian.html' title='Google Cloud VM - Senha de root do Debian'/><author><name>Kelly</name><uri>http://www.blogger.com/profile/03449060135636479990</uri><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/AVvXsEh1aFczchjWIm0WpK3EGne_XKMhohvOBR7QSPWKjs921b5vSQW5Dr9UAqC8J2KlSRz8RFOzCmWAIfSdg2vFj192xQkju45SXBfodVp2fUKV-7N-DWrViymkoJi_0KqO3oJi0r-6cziVafQ/s72-c/google_cloud_mudar_senha_root_debian.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7010404629734647455.post-578945432570583187</id><published>2017-07-30T16:19:00.005-03:00</published><updated>2017-11-12T12:38:36.518-02:00</updated><title type='text'>Exibir uma lista de views de um banco de dados no PostgreSql</title><content type='html'>&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Há três formas para exibir&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;uma lista com as views de um banco no PostgreSql :&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;1ª) Comando psql&lt;/b&gt;: você pode utilizar o comando&lt;b&gt;&amp;nbsp;&lt;span style=&quot;color: #351c75;&quot;&gt;\dv&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Neste exemplo, vamos listar as views do banco: db_teste&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&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/AVvXsEjLA6HSwXp220wdzhjQlCcrMBXKd_crZdsNMnxQiV4wWQVbYMThQatjZS-LEfVC6Oh6Cpw0Ulck69Y6ExlexiKFZj4TCzVDw7dw_Wg55Kehk0OELehhT1t8hXHzv06tugq-ByiDile6LNc/s1600/postgresql_listar_view.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;240&quot; data-original-width=&quot;601&quot; height=&quot;158&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLA6HSwXp220wdzhjQlCcrMBXKd_crZdsNMnxQiV4wWQVbYMThQatjZS-LEfVC6Oh6Cpw0Ulck69Y6ExlexiKFZj4TCzVDw7dw_Wg55Kehk0OELehhT1t8hXHzv06tugq-ByiDile6LNc/s400/postgresql_listar_view.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; text-align: justify;&quot;&gt;&lt;b&gt;2ª) Utilizar a view&lt;/b&gt; &quot;&lt;/span&gt;&lt;b style=&quot;font-family: Arial, Helvetica, sans-serif; text-align: justify;&quot;&gt;pg_views&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; text-align: justify;&quot;&gt;&quot;&amp;nbsp;para fazer uma consulta. Esta view armazena informações sobre as views do banco e já está por padrão no catálogo de objetos do postgresql. Veja a sua localização na imagem abaixo:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/span&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/AVvXsEiulwmMjdqk2TLw75iA7OLJi5Om_tqzKvxYzOJn9rzZkotoWFOad5H7gEJ6I2NDvGjPmd4g125nFpeIsnY-kekSCr3PiP5UnxbGKMiYtR9FR9jV1BSlOqOGJf2SXw5FsLzR3yJ6DvU4mfw/s1600/view+pg_tables.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;350&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiulwmMjdqk2TLw75iA7OLJi5Om_tqzKvxYzOJn9rzZkotoWFOad5H7gEJ6I2NDvGjPmd4g125nFpeIsnY-kekSCr3PiP5UnxbGKMiYtR9FR9jV1BSlOqOGJf2SXw5FsLzR3yJ6DvU4mfw/s400/view+pg_tables.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;A consulta para listar as views (inclusive as que são padrão do banco) é:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;SELECT&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;color: #351c75; font-family: arial, helvetica, sans-serif;&quot;&gt;view&lt;/b&gt;&lt;span style=&quot;color: #351c75; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;name&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #38761d; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;FROM&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #351c75; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;pg_views&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;font-family: arial, helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;ORDER BY&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;color: #351c75; font-family: arial, helvetica, sans-serif;&quot;&gt;view&lt;/b&gt;&lt;span style=&quot;color: #351c75; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;name&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Caso queira listar somente as views criada por você, faça um filtro no schema, neste exemplo só foram criadas tabelas no schema &quot;public&quot; que é padrão do postgresql.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #38761d; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; text-align: center;&quot;&gt;&lt;b&gt;SELECT&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; text-align: center;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;color: #351c75; font-family: arial, helvetica, sans-serif; text-align: center;&quot;&gt;view&lt;/b&gt;&lt;span style=&quot;color: #351c75; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; text-align: center;&quot;&gt;&lt;b&gt;name&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; text-align: center;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #38761d; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; text-align: center;&quot;&gt;&lt;b&gt;FROM&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; text-align: center;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #351c75; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; text-align: center;&quot;&gt;&lt;b&gt;pg_views&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;WHERE&lt;/span&gt;&lt;/b&gt; &lt;span style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;schemaname&lt;/b&gt;&lt;/span&gt; &lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;= &#39;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&#39;&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;font-family: Arial, Helvetica, sans-serif; text-align: center;&quot;&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;ORDER BY&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; text-align: center;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; text-align: center;&quot;&gt;&lt;b style=&quot;color: #351c75;&quot;&gt;view&lt;/b&gt;&lt;span style=&quot;color: #351c75; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; text-align: center;&quot;&gt;&lt;b&gt;name&lt;/b&gt;&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; text-align: justify;&quot;&gt;&lt;b&gt;3ª) Utilize a view &quot;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; text-align: justify;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #351c75; text-align: center;&quot;&gt;views&lt;/span&gt;&quot; &lt;/b&gt;para listar suas views. Esta view já está por padrão no catálogo de objetos do postgresql em information_schema&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; text-align: justify;&quot;&gt;.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; text-align: justify;&quot;&gt;O information_schema é um padrão ANSI, que contém views que fornecem informações sobre o banco de dados: tabela, views, colunas e procedures.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; text-align: justify;&quot;&gt;Veja a sua localização na imagem abaixo:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/span&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/AVvXsEg_KVL6_tfTh3_C0PkC9FcoM2V6Z4eik6czD1QtGo6YuMvoBJMx9cRcZQkaByFUFesKS0zAfBdmu3nfpvfcZSghPV338b9iWvLOee2LmPobc-Pt4iRaeW4xazvvhYF3ZUyjcTlm1o_aI_0/s1600/catalogo+de+objetos.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_KVL6_tfTh3_C0PkC9FcoM2V6Z4eik6czD1QtGo6YuMvoBJMx9cRcZQkaByFUFesKS0zAfBdmu3nfpvfcZSghPV338b9iWvLOee2LmPobc-Pt4iRaeW4xazvvhYF3ZUyjcTlm1o_aI_0/s1600/catalogo+de+objetos.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;SELECT&lt;/b&gt; &lt;/span&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;table_name&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;FROM&lt;/span&gt;&lt;/b&gt; &lt;span style=&quot;color: #351c75;&quot;&gt;information_schema.views&lt;/span&gt;&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;WHERE&lt;/span&gt;&lt;/b&gt; &lt;span style=&quot;color: #351c75;&quot;&gt;table_schema = &#39;public&#39;&lt;b&gt;;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; text-align: justify;&quot;&gt;Se quiser listar todas as &quot;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #351c75; text-align: center;&quot;&gt;views&lt;/span&gt;&quot; &amp;nbsp;inclusive as que são padrão do banco, execute a sentença abaixo:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #38761d; text-align: center;&quot;&gt;&lt;b&gt;SELECT&lt;/b&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #351c75; text-align: center;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;text-align: center;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;FROM&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;text-align: center;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #351c75; text-align: center;&quot;&gt;information_schema.views&lt;/span&gt;&lt;span style=&quot;color: #351c75; text-align: center;&quot;&gt;&lt;b&gt;;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large; text-align: justify;&quot;&gt;&lt;b&gt;VISUALIZAR O CONTEÚDO DE UMA VIEW ATRAVÉS DA LINHA DE COMANDO&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;span style=&quot;color: black; text-align: justify;&quot;&gt;Para visualizar o conteúdo de uma view utilize o comando psql&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b style=&quot;font-family: arial, helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;\d+ nome_view.&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Neste caso:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #20124d; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; text-align: justify;&quot;&gt;&amp;nbsp;\d+&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; text-align: justify;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #38761d; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; text-align: justify;&quot;&gt;vw_clientes&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; text-align: justify;&quot;&gt;Veja a imagem abaixo:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b style=&quot;font-family: arial, helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&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/AVvXsEjdhPH1cz3TRpIT4XOH2QCzH8f08XV98Ef8LD70Bd7WQO7zon4J-gi0XKujIispohCM6-XTk1bDd50sqHiaikkvu-yUgTNvJVjFPVzCl4bsJK6UoReyafk3tWROviTMqW463V6u54Teiak/s1600/visualizar_view_postgresql.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;207&quot; data-original-width=&quot;666&quot; height=&quot;124&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdhPH1cz3TRpIT4XOH2QCzH8f08XV98Ef8LD70Bd7WQO7zon4J-gi0XKujIispohCM6-XTk1bDd50sqHiaikkvu-yUgTNvJVjFPVzCl4bsJK6UoReyafk3tWROviTMqW463V6u54Teiak/s400/visualizar_view_postgresql.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jquerydicas.blogspot.com/feeds/578945432570583187/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://jquerydicas.blogspot.com/2017/07/exibir-uma-lista-de-views-de-um-banco.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/578945432570583187'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/578945432570583187'/><link rel='alternate' type='text/html' href='http://jquerydicas.blogspot.com/2017/07/exibir-uma-lista-de-views-de-um-banco.html' title='Exibir uma lista de views de um banco de dados no PostgreSql'/><author><name>Kelly</name><uri>http://www.blogger.com/profile/03449060135636479990</uri><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/AVvXsEjLA6HSwXp220wdzhjQlCcrMBXKd_crZdsNMnxQiV4wWQVbYMThQatjZS-LEfVC6Oh6Cpw0Ulck69Y6ExlexiKFZj4TCzVDw7dw_Wg55Kehk0OELehhT1t8hXHzv06tugq-ByiDile6LNc/s72-c/postgresql_listar_view.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7010404629734647455.post-5262295526951268690</id><published>2017-07-29T11:32:00.000-03:00</published><updated>2017-07-29T13:38:24.939-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="function postgresql string"/><category scheme="http://www.blogger.com/atom/ns#" term="funções de manipulação de string"/><category scheme="http://www.blogger.com/atom/ns#" term="postgresql"/><category scheme="http://www.blogger.com/atom/ns#" term="rpad"/><title type='text'>Postgresql - Função rpad</title><content type='html'>&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Neste artigo, vamos mostrar 2 exemplos, da utilização da função RPAD.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Utilizamos a função RPAD para completar uma string do lado direito com determinado(s) caractere(s).&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Veja o script dos exemplos no &lt;a href=&quot;https://github.com/kellysc2013/dicas_sql_jquery/blob/master/Postgresql%20-%20fun%C3%A7%C3%A3o%20RPAD.sql&quot; target=&quot;_blank&quot;&gt;GitHub&lt;/a&gt;&amp;nbsp;ou faça o &lt;a href=&quot;https://drive.google.com/open?id=0B7sttJEXxZumcDBNdm5XWGpIS3c&quot; target=&quot;_blank&quot;&gt;download &lt;/a&gt;no Google Drive.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;SINTAXE&lt;/b&gt;&lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;RPAD (&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;string&lt;/span&gt;, &lt;span style=&quot;color: #741b47;&quot;&gt;posicao_de_caracteres&lt;/span&gt;,&lt;span style=&quot;color: #351c75;&quot;&gt; &lt;b&gt;&#39;&lt;/b&gt;caracter_para_preechimento&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;&#39;&lt;/span&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;)&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;string&lt;span style=&quot;color: black;&quot;&gt;: sequëncia de caracteres; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #741b47;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt; &lt;span style=&quot;color: #741b47;&quot;&gt;posicao_de_caracteres&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;: indica até que posição a string será preenchida;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;span style=&quot;color: #351c75;&quot;&gt; caracter_para_preechimento&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;caractere(s) utilizado(s) para o preenchimento, estes caracteres devem estar entre aspas;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;1º Exemplo&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Completar com o asterisco (*) a direita dos nomes dos produtos até a 10ª posição.&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Neste exemplo, vamos utilizar a coluna &quot;nome_produto&quot; tabela &quot;tb_produto&quot;, exibida na imagem abaixo.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdW2AwTjl5SIZybypF480RkLQjYC_HjqdGEmA4dvVYJL3kLBSaOhEjhOFkVl282fqahj6acZ-py32Cd09jGiG6IU6u69LHy5Pcta_6FlY0nUKyCew_7KdX4j5H4r46dRj2-BQ0HGVfEcw/s1600/tb_produto.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;191&quot; data-original-width=&quot;276&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdW2AwTjl5SIZybypF480RkLQjYC_HjqdGEmA4dvVYJL3kLBSaOhEjhOFkVl282fqahj6acZ-py32Cd09jGiG6IU6u69LHy5Pcta_6FlY0nUKyCew_7KdX4j5H4r46dRj2-BQ0HGVfEcw/s1600/tb_produto.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;tb_produto&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;b style=&quot;font-size: x-large;&quot;&gt;Solução&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
SELECT &lt;br /&gt;
nome_produto, &lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;RPAD (&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;nome_produto&lt;/span&gt;,&lt;span style=&quot;color: #741b47;&quot;&gt;10&lt;/span&gt;, &lt;b&gt;&#39;&lt;/b&gt;*&lt;b&gt;&#39;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;) &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;AS nome_produto_com_asterisco&lt;br /&gt;
FROM tb_produto;&lt;br /&gt;
&lt;br /&gt;
Após a execução da sentença, teremos o seguinte resultado:&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/AVvXsEi9wHVx9QKEYUYoYZiS1CMhD2zoPuPjCcPgg_B6txadd9pjwcSB_H5qhfoA6DmohYMD1FRcqYteDr500tyERDUQyXWUcSyVFyFy0RRZRo7_a5V8RtAPP-_9Hc5yBYWQZX6_-CHu7GafIWY/s1600/funcao_rpad_exemplo.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;191&quot; data-original-width=&quot;344&quot; height=&quot;177&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9wHVx9QKEYUYoYZiS1CMhD2zoPuPjCcPgg_B6txadd9pjwcSB_H5qhfoA6DmohYMD1FRcqYteDr500tyERDUQyXWUcSyVFyFy0RRZRo7_a5V8RtAPP-_9Hc5yBYWQZX6_-CHu7GafIWY/s320/funcao_rpad_exemplo.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Observações&lt;/b&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;lápis&lt;/b&gt;:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tem&lt;span style=&quot;color: #20124d;&quot;&gt; &lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;b&gt;5&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp; caracteres e foi preenchida com &lt;span style=&quot;background-color: #0b5394;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;5&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt; caracteres para completar as &lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;10&lt;/span&gt;&lt;/b&gt; posições;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;caderno&lt;/b&gt;:&amp;nbsp; tem&lt;span style=&quot;color: #20124d;&quot;&gt; &lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;b&gt;7&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;  caracteres e foi preenchida com &lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;b&gt;3&lt;/b&gt;&lt;/span&gt; caracteres para completar as &lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;10&lt;/span&gt;&lt;/b&gt; posições;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;borracha&lt;/b&gt;: tem &lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;8&lt;/span&gt;&lt;/b&gt; caracteres e foi preenchida com &lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;b&gt;2&lt;/b&gt;&lt;/span&gt; caracteres para completar as &lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;b&gt;10&lt;/b&gt;&lt;/span&gt; posições;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;cartolina&lt;/b&gt;: tem &lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;9 &lt;/span&gt;&lt;/b&gt;caracteres e foi preenchida com &lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;b&gt;1&lt;/b&gt;&lt;/span&gt; caractere&amp;nbsp; para completar as&amp;nbsp; &lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;10&lt;/span&gt;&lt;/b&gt; posições;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;No lugar do asterisco&amp;nbsp;&lt;span style=&quot;background-color: white; color: #674ea7; font-family: &amp;quot;times new roman&amp;quot;;&quot;&gt;(*)&lt;/span&gt;, poderíamos utilizar qualquer outro caractere alfanumérico ou caractere especial.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Por exemplo: uma ou mais letras, dígitos, espaços, hífen entre outros. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;b&gt; &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;2º Exemplo&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Preencher com asterisco (*) a direita, &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;até a 5ª posição&lt;/span&gt;, os códigos dos produtos. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Neste exemplo, vamos utilizar a coluna &quot;codigo_produto&quot; tabela &quot;tb_produto&quot;, exibida na imagem abaixo.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9OMNSFqYcKnZVfenZJbuKWL_FTKN4fa2k1KZO1IuKOZODr5u_1U9bSh9ZqtN8N0VN-6o65crhiIv9xN6t_O-GwCLjZ2Gg8ykUGo6iC_WwpYCu0QHI3jEARQoeHGzNZVnEQ4-5Sx_DwVs/s1600/tb_produto.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;191&quot; data-original-width=&quot;276&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9OMNSFqYcKnZVfenZJbuKWL_FTKN4fa2k1KZO1IuKOZODr5u_1U9bSh9ZqtN8N0VN-6o65crhiIv9xN6t_O-GwCLjZ2Gg8ykUGo6iC_WwpYCu0QHI3jEARQoeHGzNZVnEQ4-5Sx_DwVs/s1600/tb_produto.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;tb_produto&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;br /&gt;Solução&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Como a função RPAD completa uma string, antes de utilizarmos a função RPAD, neste exemplo, devemos utilizar a função CAST para converter a coluna codigo_produto que é do tipo integer (número inteiro) para string (CHARACTER VARYING ou VARCHAR como é mais conhecido).&lt;br /&gt;
&lt;br /&gt;
SELECT&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;RPAD (&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;CAST(codigo_produto AS VARCHAR)&lt;/span&gt;, &lt;span style=&quot;color: #741b47;&quot;&gt;5&lt;/span&gt;, &lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #674ea7;&quot;&gt;&lt;b&gt;&#39;&lt;/b&gt;*&lt;b&gt;&#39;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;)&lt;/span&gt;&lt;/b&gt;&lt;/span&gt; AS codigo_produto,&amp;nbsp; &lt;br /&gt;
nome_produto&lt;br /&gt;
FROM tb_produto;&lt;br /&gt;
&lt;br /&gt;
Após a execução da sentença, teremos o seguinte resultado:&lt;br /&gt;
&lt;br /&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/AVvXsEjedM6gJiYxzv66drYxNv_zmYGNyIxkDQzUd4e88L7ImW6XVrG3yCL3e7X0sl4QOxVFiV43SL1MNA58CDwQZvc3Lh1fjiNhWgYdUYO-JA7xCJ7bZSECsM95j7Q5MpBntc-aXSScRuW5-Vg/s1600/rpad_tipo_integer_exemplo.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;191&quot; data-original-width=&quot;277&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjedM6gJiYxzv66drYxNv_zmYGNyIxkDQzUd4e88L7ImW6XVrG3yCL3e7X0sl4QOxVFiV43SL1MNA58CDwQZvc3Lh1fjiNhWgYdUYO-JA7xCJ7bZSECsM95j7Q5MpBntc-aXSScRuW5-Vg/s1600/rpad_tipo_integer_exemplo.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;Observações&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;O número&amp;nbsp;&amp;nbsp; &lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;8426 &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;tem&amp;nbsp;&amp;nbsp; 4 dígitos, e foi preenchido com 1 * para completar 5 dígitos; &lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;background-color: black;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;background-color: black;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;background-color: black;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;O número&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;438 &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;tem&amp;nbsp;&amp;nbsp; 3 dígitos, e foi preenchido com 2 *&amp;nbsp;para completar 5 dígitos; &lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;background-color: black;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;background-color: black;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;background-color: black;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;O número&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;22 &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;tem&amp;nbsp;&amp;nbsp; 2 dígitos, e foi preenchido com 3 *&amp;nbsp;para completar 5 dígitos;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;O número &lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;16547 &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;tem &amp;nbsp; 5 dígitos, logo&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;b&gt; não foi preenchido com *&lt;/b&gt;&lt;/span&gt;, pois já contém 5 dígitos&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;;&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
Aprenda também a utiliza a função&amp;nbsp;&lt;a href=&quot;http://jquerydicas.blogspot.com.br/2014/09/postgresql-funcao-lpad.html&quot; target=&quot;_blank&quot;&gt;lpad&lt;/a&gt;:&lt;br /&gt;
&lt;br /&gt;
http://jquerydicas.blogspot.com.br/2014/09/postgresql-funcao-lpad.html&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Deixe o seu comentário ou sugestão.&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Gostou?&amp;nbsp; Siga no Google +&amp;nbsp; &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: small;&quot;&gt;ou Facebook&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;.&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt; </content><link rel='replies' type='application/atom+xml' href='http://jquerydicas.blogspot.com/feeds/5262295526951268690/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://jquerydicas.blogspot.com/2017/07/postgresql-funcao-rpad.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/5262295526951268690'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/5262295526951268690'/><link rel='alternate' type='text/html' href='http://jquerydicas.blogspot.com/2017/07/postgresql-funcao-rpad.html' title='Postgresql - Função rpad'/><author><name>Kelly</name><uri>http://www.blogger.com/profile/03449060135636479990</uri><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/AVvXsEhdW2AwTjl5SIZybypF480RkLQjYC_HjqdGEmA4dvVYJL3kLBSaOhEjhOFkVl282fqahj6acZ-py32Cd09jGiG6IU6u69LHy5Pcta_6FlY0nUKyCew_7KdX4j5H4r46dRj2-BQ0HGVfEcw/s72-c/tb_produto.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7010404629734647455.post-1205813085896507970</id><published>2017-07-09T11:27:00.005-03:00</published><updated>2017-07-09T12:02:07.186-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="concat"/><category scheme="http://www.blogger.com/atom/ns#" term="function concat sql server"/><category scheme="http://www.blogger.com/atom/ns#" term="função sql server"/><category scheme="http://www.blogger.com/atom/ns#" term="funções de manipulação de string"/><category scheme="http://www.blogger.com/atom/ns#" term="juntar string sql server"/><category scheme="http://www.blogger.com/atom/ns#" term="operator concat sql server"/><category scheme="http://www.blogger.com/atom/ns#" term="unir string sql server"/><title type='text'>Sql Server - função concat e operador de concatenação</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Neste artigo, vamos apresentar exemplos da utilização do operador de concatenação&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;e do uso da funçao concat no Sql Server. Tanto o &quot;operador de concatenação&quot; quanto a função &quot;concat&quot;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;servem para unir uma ou mais strings.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;A função concat é mais simples de ser utilizada do que o operador de concatenação, pois ela ignora dados nulos, e concatena diferentes tipos de dados sem necessitar de conversão, porém só pode ser utilizada na versão 2012 ou em versões posteriores.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Caso tenha interesse faça o &lt;a href=&quot;https://drive.google.com/open?id=0B7sttJEXxZumbDlyUktMdGR3RFk&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;download&lt;/a&gt; dos exemplos ou veja os scripts no &lt;a href=&quot;https://github.com/kellysc2013/dicas_sql_jquery/blob/master/Sql%20Server%20-%20fun%C3%A7%C3%A3o%20concat%20e%20operador%20de%20concatena%C3%A7%C3%A3o.sql&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;GitHub&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;color: #999999; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;Operador de concatenação&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;O operador de concatenação é representados por &quot;&lt;b style=&quot;font-family: &amp;quot;times new roman&amp;quot;; text-align: center;&quot;&gt;&lt;span style=&quot;color: #073763;&quot;&gt;+&lt;/span&gt;&lt;/b&gt;&quot;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #0b5394; font-family: &amp;quot;times new roman&amp;quot;;&quot;&gt;coluna_1&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot;;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #741b47;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;b style=&quot;font-family: &amp;quot;times new roman&amp;quot;;&quot;&gt;&lt;span style=&quot;color: #073763;&quot;&gt;+&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #0b5394; font-family: &amp;quot;times new roman&amp;quot;;&quot;&gt;coluna_2&lt;/span&gt;&lt;span style=&quot;color: #0b5394; font-family: &amp;quot;times new roman&amp;quot;;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #741b47;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #073763;&quot;&gt;+&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp;&lt;/span&gt;coluna_3&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Exemplo:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Vamos apresentar os endereços completos das filiais de uma rede de varejo.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Será utilizado os dados das colunas da tabela &quot;locacao_filiais&quot;, exibida a seguir.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Antes de cada endereço vai ser exibida a string &quot;Endereço: &quot;.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfTDqneM0TCZerX8jjLXbF9agP5TX1D8kT50hf27LthfLbtz4wIVBqKjlt3bL4-foMelCpNm7o6ol1gufgjQSIYYdJPf1TIPZBJQtYfawcdglhzX2IhaiLa8wpaYRSLtp5xucuZDNKf1M/s1600/locacao_filiais_ss.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;77&quot; data-original-width=&quot;418&quot; height=&quot;72&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfTDqneM0TCZerX8jjLXbF9agP5TX1D8kT50hf27LthfLbtz4wIVBqKjlt3bL4-foMelCpNm7o6ol1gufgjQSIYYdJPf1TIPZBJQtYfawcdglhzX2IhaiLa8wpaYRSLtp5xucuZDNKf1M/s400/locacao_filiais_ss.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Tabela: locacao_filiais&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Para exibirmos os campos da tabela&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&quot;locacao_filiais&quot; concatenados&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;, executamos a sentença abaixo:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #38761d; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; text-align: left;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: #38761d; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; text-align: left;&quot;&gt;&lt;b&gt;SELECT&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; text-align: left;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #a64d79;&quot;&gt;&#39;Endereço: &#39;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;b style=&quot;font-family: arial, helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #073763;&quot;&gt;+&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;tipo_logradouro&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b style=&quot;color: #38761d; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;+&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #a64d79;&quot;&gt;&#39; &#39;&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;font-family: arial, helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;+&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;logradouro&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;color: #38761d; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;+&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;span style=&quot;color: #a64d79;&quot;&gt;&#39; &#39;&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;font-family: arial, helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;+&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #4c1130;&quot;&gt;CAST(&lt;/span&gt;&lt;/b&gt;&lt;b style=&quot;color: #38761d;&quot;&gt;numero AS VARCHAR&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;color: #4c1130;&quot;&gt;)&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;color: #38761d; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;+&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;span style=&quot;color: #a64d79;&quot;&gt;&#39; &#39;&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;font-family: arial, helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;+&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;complemento&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;color: #38761d; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;+&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;span style=&quot;color: #a64d79;&quot;&gt;&#39; &#39;&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;font-family: arial, helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;+&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #38761d; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;bairro&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;FROM locacao_filiais;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Após a execução da sentença, teremos os campos concatenados . Conforme podemos visualizar na imagem abaixo:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;/span&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/AVvXsEjm_B4ZEADlZu_ScUdi2cLqtQ7iRbbxBh5uNEbIIqts8DWZD6fLAzOiKv1WyElcblpt1UFNFeCKhzlLtVTGFuKWUNmiCxEBaGYCyACvj2TTEoT8OSZhM7xLrFwGcXlo6N1PZptVx3zVP5U/s1600/locacao_filiais_ss_campos_nulos.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;79&quot; data-original-width=&quot;379&quot; height=&quot;66&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjm_B4ZEADlZu_ScUdi2cLqtQ7iRbbxBh5uNEbIIqts8DWZD6fLAzOiKv1WyElcblpt1UFNFeCKhzlLtVTGFuKWUNmiCxEBaGYCyACvj2TTEoT8OSZhM7xLrFwGcXlo6N1PZptVx3zVP5U/s320/locacao_filiais_ss_campos_nulos.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;color: #990000; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;Observações:&lt;/b&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Concatenamos espaço em branco (&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #a64d79; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&#39; &#39;&lt;/span&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;) entre os campos para os dados não fiquem &quot;grudados&quot; uns nos outros.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Repare que utilizamos a função &quot;&lt;b style=&quot;color: black;&quot;&gt;&lt;span style=&quot;color: #4c1130;&quot;&gt;CAST&lt;/span&gt;&lt;/b&gt;&quot; para converter o campo &quot;numero&quot; que é do tipo int (valor inteiro) para varchar (texto). Se concatenarmos valores numéricos e não utilizarmos o CAST ocorrerá o seguinte erro:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #0b5394; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Mensagem 245, Nível 16, Estado 1, Linha 52&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Falha ao converter o varchar valor &#39;Endereço: Avenida Domingos de Moraes &#39; para o tipo de dados int.&lt;/span&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;/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;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #990000;&quot;&gt;Você deve estar pensando o que ocorreu? Por que somente o primeiro registro apareceu concatenado? Cadê os outros?&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Se você observar os&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0b5394; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;dois&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;últimos registros, verá que eles não possuem dados na &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0b5394; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;coluna complemento&lt;/span&gt;&lt;b style=&quot;color: #0b5394; font-family: Arial, Helvetica, sans-serif;&quot;&gt;,&amp;nbsp;&lt;/b&gt;&lt;span style=&quot;color: #0b5394; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;ou seja, os dados são nulos nesta coluna. &lt;b&gt;Ao fazer uma concatenação com um dado nulo, o resultado é nulo.&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: #0b5394; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #990000;&quot;&gt;Como vamos resolver isto?&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: #0b5394; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Antes de fazer a concatenação da &lt;b&gt;coluna complemento&lt;/b&gt; faremos uma &lt;b&gt;verificação&lt;/b&gt;. Se houver dados no campo,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0b5394; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;faremos a concatenação com os dados deste campo.&lt;/span&gt;&lt;span style=&quot;color: #0b5394; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;Caso contrário substituiremos o dado nulo por uma string vazia&lt;/span&gt;&lt;span style=&quot;color: #0b5394; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;(&lt;/span&gt;&lt;span style=&quot;color: #a64d79; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;).&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0b5394; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;Para isso utilizaremos a função&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;color: #0b5394; font-family: Arial, Helvetica, sans-serif;&quot;&gt;coalesce&lt;/b&gt;&lt;span style=&quot;color: #0b5394; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;, conforme exibido na sentença abaixo.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #38761d; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; text-align: left;&quot;&gt;&lt;b&gt;SELECT&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; text-align: left;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #a64d79;&quot;&gt;&#39;Endereço: &#39;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;b style=&quot;font-family: arial, helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #073763;&quot;&gt;+&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;tipo_logradouro&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b style=&quot;color: #38761d; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;+&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #a64d79;&quot;&gt;&#39; &#39;&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;font-family: arial, helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;+&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;logradouro&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;color: #38761d; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;+&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;span style=&quot;color: #a64d79;&quot;&gt;&#39; &#39;&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;font-family: arial, helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;+&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #4c1130;&quot;&gt;CAST(&lt;/span&gt;&lt;/b&gt;&lt;b style=&quot;color: #38761d;&quot;&gt;numero AS VARCHAR&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;color: #4c1130;&quot;&gt;)&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;color: #38761d; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;+&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;span style=&quot;color: #a64d79;&quot;&gt;&#39; &#39;&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;font-family: arial, helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;+&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b style=&quot;color: #38761d; font-family: arial, helvetica, sans-serif;&quot;&gt;COALESCE(complemento, &#39;&#39;)&amp;nbsp;&lt;/b&gt;&lt;b style=&quot;font-family: arial, helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;+&lt;/span&gt;&lt;/b&gt;&lt;b style=&quot;color: #38761d; font-family: arial, helvetica, sans-serif;&quot;&gt;&amp;nbsp;&#39; &#39;&amp;nbsp;&lt;/b&gt;&lt;b style=&quot;font-family: arial, helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;+&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #38761d; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;bairro&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;FROM locacao_filiais;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;b style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Após a execução da sentença, os dados dos três registros serão exibidos. Conforme podemos visualizar na imagem abaixo:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&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/AVvXsEird28IZIaplY1-iBcDzAk6wuCyEZ_e2QNsLa25bLfem1NDiMDrPfcXW5S6GmFoTUPNOgH7Ki8oyydGjlGsmSlDL8ynunQUMue9pDzb67Kx27fKlTtJVOpClkoFJd5uHmzDO5pSANFb09U/s1600/locacao_filiais_ss_campos_concat_operator_coalesce.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;75&quot; data-original-width=&quot;362&quot; height=&quot;82&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEird28IZIaplY1-iBcDzAk6wuCyEZ_e2QNsLa25bLfem1NDiMDrPfcXW5S6GmFoTUPNOgH7Ki8oyydGjlGsmSlDL8ynunQUMue9pDzb67Kx27fKlTtJVOpClkoFJd5uHmzDO5pSANFb09U/s400/locacao_filiais_ss_campos_concat_operator_coalesce.png&quot; width=&quot;400&quot; /&gt;&lt;/a&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: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;O nome da coluna será exibido como &quot;(Nenhum nome de coluna)&quot;. Caso queira alterar este nome, crie um alias (apelido). Após o &quot;AS&quot; coloque o nome da coluna que você precisa. Neste exemplo, eu vou chamá-la de filiais.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #38761d; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; text-align: left;&quot;&gt;&lt;b&gt;SELECT&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; text-align: left;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #a64d79;&quot;&gt;&#39;Endereço: &#39;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;b style=&quot;font-family: arial, helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #073763;&quot;&gt;+&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;tipo_logradouro&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b style=&quot;color: #38761d; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;+&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #a64d79;&quot;&gt;&#39; &#39;&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;font-family: arial, helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;+&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;logradouro&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;color: #38761d; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;+&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;span style=&quot;color: #a64d79;&quot;&gt;&#39; &#39;&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;font-family: arial, helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;+&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #4c1130;&quot;&gt;CAST(&lt;/span&gt;&lt;/b&gt;&lt;b style=&quot;color: #38761d;&quot;&gt;numero AS VARCHAR&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;color: #4c1130;&quot;&gt;)&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;color: #38761d; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;+&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;span style=&quot;color: #a64d79;&quot;&gt;&#39; &#39;&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;font-family: arial, helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;+&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b style=&quot;color: #38761d; font-family: arial, helvetica, sans-serif;&quot;&gt;COALESCE(complemento, &#39;&#39;)&amp;nbsp;&lt;/b&gt;&lt;b style=&quot;font-family: arial, helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;+&lt;/span&gt;&lt;/b&gt;&lt;b style=&quot;color: #38761d; font-family: arial, helvetica, sans-serif;&quot;&gt;&amp;nbsp;&#39; &#39;&amp;nbsp;&lt;/b&gt;&lt;b style=&quot;font-family: arial, helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;+&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #38761d; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;bairro&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #351c75; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;AS filiais&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;FROM locacao_filiais;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Após a execução da sentença, o nome da coluna será exibido como &quot;filiais&quot;, conforme exibido na imagem abaixo:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&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/AVvXsEgIh69m0zuqLRhK6IIc0u_-WXorvqRZpwZSs02sTigL1U0YY-zV5ii7-EfrRsu_wfWnqM84fR_r6ZdnSKB9jS8iD1aKMk9cMKRoB8oYbMhhGof8eh1HfgP6elkxTVXTusRpH-jTlRbaXLk/s1600/locacao_filiais_ss_campos_concat_operator_coalesce_alias.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;76&quot; data-original-width=&quot;365&quot; height=&quot;82&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIh69m0zuqLRhK6IIc0u_-WXorvqRZpwZSs02sTigL1U0YY-zV5ii7-EfrRsu_wfWnqM84fR_r6ZdnSKB9jS8iD1aKMk9cMKRoB8oYbMhhGof8eh1HfgP6elkxTVXTusRpH-jTlRbaXLk/s400/locacao_filiais_ss_campos_concat_operator_coalesce_alias.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;b style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&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;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: white; text-align: left;&quot;&gt;&lt;span style=&quot;color: #999999; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;Função concat&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: white; text-align: left;&quot;&gt;&lt;span style=&quot;color: #999999; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;A função concat surgiu a partir da versão 2012, logo ela funcionará nesta versão ou em versões posteriores. Ela tem função similar ao operador de concatenação &quot;&lt;span style=&quot;color: #741b47;&quot;&gt;+&lt;/span&gt;&quot;. E&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;la possui duas&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;font-family: arial, helvetica, sans-serif;&quot;&gt;&amp;nbsp;vantagens&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;:&lt;/span&gt;&lt;b style=&quot;font-family: arial, helvetica, sans-serif;&quot;&gt;&amp;nbsp;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;a&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;lém de unir valores numérico sem utilizar conversão, também&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;ignora dados nulos.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Exemplo:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Este exemplo é bem parecido com o primeiro exemplo.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Vamos apresentar os endereços completos das filiais de uma rede de varejo, &lt;b&gt;mas agora será utilizada a função concat&lt;/b&gt;.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Será utilizado os dados das colunas da tabela &quot;locacao_filiais&quot;, exibida a seguir.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Antes de cada endereço vai ser exibida a string &quot;Endereço: &quot;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaetqgER4JV8hy20jqDZ31E_K54-wtV3vHQp2wazkICqgPdVSs7kRaK87-jj97gbfEVYNw1pk4TQhzGfbrBkY9RAAACBmkfRWm5ZND4NvZGI7eBr34eoBgOglc-QE2UgDXJyMheES6D9Q/s1600/locacao_filiais_ss.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;77&quot; data-original-width=&quot;418&quot; height=&quot;72&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaetqgER4JV8hy20jqDZ31E_K54-wtV3vHQp2wazkICqgPdVSs7kRaK87-jj97gbfEVYNw1pk4TQhzGfbrBkY9RAAACBmkfRWm5ZND4NvZGI7eBr34eoBgOglc-QE2UgDXJyMheES6D9Q/s400/locacao_filiais_ss.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Tabela: locacao_filiais&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Na funcão concat os dados que serão utilizados deverão estar entre virgulas.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;CONCAT(coluna_1&lt;/span&gt;&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;b&gt;,&lt;/b&gt;&lt;/span&gt; &lt;span style=&quot;color: #0b5394;&quot;&gt;coluna_2&lt;/span&gt;&lt;b style=&quot;color: #741b47;&quot;&gt;,&lt;/b&gt;&amp;nbsp;&lt;span style=&quot;color: #0b5394;&quot;&gt;coluna_3&lt;/span&gt;&lt;b style=&quot;color: #741b47;&quot;&gt;,&lt;/b&gt;&amp;nbsp;....&lt;span style=&quot;color: #0b5394;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Utilizamos a função concat na sentença abaixo:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;b style=&quot;color: #38761d; font-family: Arial, Helvetica, sans-serif;&quot;&gt;SELECT&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;CONCAT&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;(&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #a64d79; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &#39;Endereço: &#39;&lt;/span&gt;&lt;b style=&quot;color: #741b47; text-align: center;&quot;&gt;,&lt;/b&gt;&lt;span style=&quot;color: #a64d79; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #38761d; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;tipo_logradouro&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #a64d79; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&#39; &#39;&lt;/span&gt;&lt;b style=&quot;color: #741b47; text-align: center;&quot;&gt;,&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;logradouro&lt;/span&gt;&lt;/b&gt;&lt;b style=&quot;color: #741b47; text-align: center;&quot;&gt;,&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #a64d79; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&#39; &#39;&lt;/span&gt;&lt;b style=&quot;color: #741b47; text-align: center;&quot;&gt;,&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;numero&lt;/span&gt;&lt;/b&gt;&lt;b style=&quot;color: #741b47; text-align: center;&quot;&gt;,&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #a64d79; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&#39; &#39;&lt;/span&gt;&lt;b style=&quot;color: #741b47; text-align: center;&quot;&gt;,&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;complemento&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;color: #741b47; text-align: center;&quot;&gt;,&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #a64d79; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&#39; &#39;&lt;/span&gt;&lt;b style=&quot;color: #741b47; text-align: center;&quot;&gt;,&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;bairro&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;)&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;b style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;FROM locacao_filiais;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;b style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;Observação:&lt;/b&gt;&amp;nbsp;Concatenamos espaço em branco (&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #a64d79; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&#39; &#39;&lt;/span&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;) entre os campos para os dados não ficarem &quot;grudados&quot; uns nos outros.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Após a execução da sentença será exibido o resultado a seguir:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&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/AVvXsEjOv5-wQtqycdaRtF1pIJNGfhGq6nmLMleodzkvHjz0r2H2cfqJ4NrelRlo4yuYzP4yVwPB8HRCH8WNxTT01AnIa7M_yWPdj-zEoA3Cqvt90SxIdEja1NGjTM_gIvan0tS8DOo_eV5Duyc/s1600/locacao_filiais_ss_campos_concat_function.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;76&quot; data-original-width=&quot;366&quot; height=&quot;82&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOv5-wQtqycdaRtF1pIJNGfhGq6nmLMleodzkvHjz0r2H2cfqJ4NrelRlo4yuYzP4yVwPB8HRCH8WNxTT01AnIa7M_yWPdj-zEoA3Cqvt90SxIdEja1NGjTM_gIvan0tS8DOo_eV5Duyc/s400/locacao_filiais_ss_campos_concat_function.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Perceba que foram exibidos os três registros concatenados e não houve a necessidade de se preocupar em tratar os dados nulos, pois na função concat eles são ignorados.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;O nome da coluna será exibido como &quot;(Nenhum nome de coluna)&quot;. Caso queira alterar este nome, crie um alias (apelido). Após o &quot;AS&quot; coloque o nome da coluna que você precisa. Neste exemplo, eu vou chamá-la de filiais.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;b style=&quot;color: #38761d; font-family: Arial, Helvetica, sans-serif;&quot;&gt;SELECT&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;CONCAT&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;(&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #a64d79; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &#39;Endereço: &#39;&lt;/span&gt;&lt;b style=&quot;color: #741b47; text-align: center;&quot;&gt;,&lt;/b&gt;&lt;span style=&quot;color: #a64d79; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #38761d; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;tipo_logradouro&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #a64d79; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&#39; &#39;&lt;/span&gt;&lt;b style=&quot;color: #741b47; text-align: center;&quot;&gt;,&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;logradouro&lt;/span&gt;&lt;/b&gt;&lt;b style=&quot;color: #741b47; text-align: center;&quot;&gt;,&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #a64d79; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&#39; &#39;&lt;/span&gt;&lt;b style=&quot;color: #741b47; text-align: center;&quot;&gt;,&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;numero&lt;/span&gt;&lt;/b&gt;&lt;b style=&quot;color: #741b47; text-align: center;&quot;&gt;,&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #a64d79; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&#39; &#39;&lt;/span&gt;&lt;b style=&quot;color: #741b47; text-align: center;&quot;&gt;,&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;complemento&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;color: #741b47; text-align: center;&quot;&gt;,&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #a64d79; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&#39; &#39;&lt;/span&gt;&lt;b style=&quot;color: #741b47; text-align: center;&quot;&gt;,&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;bairro&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;) AS filiais&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;b style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;FROM locacao_filiais;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;b style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Após a execução da sentença, o nome da coluna será exibido como &quot;filiais&quot;, conforme exibido na imagem abaixo:&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&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/AVvXsEi1YzrsYbNgD1-wAqbUd3VdQxvC5YQtr1Dly8SW7iPlMb99eJImKuPEAF_tMPBqOc065aiEK1M7W_Pc-WZ-aT1rrxjvHGouDH8s-MKR-8VEktyrAXRSsfhDNSpBHTrXKRbLZ2jzd-y3dP8/s1600/locacao_filiais_ss_campos_concat_function_alias_V2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;79&quot; data-original-width=&quot;294&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1YzrsYbNgD1-wAqbUd3VdQxvC5YQtr1Dly8SW7iPlMb99eJImKuPEAF_tMPBqOc065aiEK1M7W_Pc-WZ-aT1rrxjvHGouDH8s-MKR-8VEktyrAXRSsfhDNSpBHTrXKRbLZ2jzd-y3dP8/s1600/locacao_filiais_ss_campos_concat_function_alias_V2.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;b style=&quot;color: #741b47;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Deixe o seu comentário ou sugestão.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;b&gt;Gostou?&amp;nbsp; Siga no Google + ou Facebook&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;b&gt;.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jquerydicas.blogspot.com/feeds/1205813085896507970/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://jquerydicas.blogspot.com/2017/07/sql-server-funcao-concat-e-operador-de.html#comment-form' title='2 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/1205813085896507970'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/1205813085896507970'/><link rel='alternate' type='text/html' href='http://jquerydicas.blogspot.com/2017/07/sql-server-funcao-concat-e-operador-de.html' title='Sql Server - função concat e operador de concatenação'/><author><name>Kelly</name><uri>http://www.blogger.com/profile/03449060135636479990</uri><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/AVvXsEjfTDqneM0TCZerX8jjLXbF9agP5TX1D8kT50hf27LthfLbtz4wIVBqKjlt3bL4-foMelCpNm7o6ol1gufgjQSIYYdJPf1TIPZBJQtYfawcdglhzX2IhaiLa8wpaYRSLtp5xucuZDNKf1M/s72-c/locacao_filiais_ss.png" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7010404629734647455.post-4616432602006367723</id><published>2017-06-24T20:04:00.001-03:00</published><updated>2017-07-08T19:22:45.406-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="comando select into no sql server"/><category scheme="http://www.blogger.com/atom/ns#" term="copiar dados de uma tabela para uma nova tabela no sql server"/><category scheme="http://www.blogger.com/atom/ns#" term="What is the equivalent of &#39;CREATE TABLE SELECT&#39; in SQL SERVER"/><title type='text'>Criar uma tabela no SQL SERVER  a partir de uma tabela existente</title><content type='html'>&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Este post mostra como criar uma tabela no SQL SERVER &amp;nbsp;a partir de uma tabela existente.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;A nova tabela será criada com os mesmos&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;nomes das colunas,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;os mesmos tipos de dados&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;e os mesmos registros da tabela original do instante em que se executa o comando abaixo:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: red; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;SINTAXE&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;color: #20124d; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;SELECT &amp;nbsp;* &amp;nbsp;INTO&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #274e13; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;color: black;&quot;&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;nova_tabela&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;font-family: arial, helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;FROM &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;tabela_original&lt;/span&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Caso tenha interesse, veja o script no&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;https://github.com/kellysc2013/dicas_sql_jquery/blob/master/copiar_dados_de_uma_tabela_para_uma_nova_tabela_no_SQL_SERVER/Criar%20uma%20tabela%20no%20SQL%20SERVER%20a%20partir%20de%20uma%20tabela%20existente.sql&quot; style=&quot;font-family: arial, helvetica, sans-serif;&quot; target=&quot;_blank&quot;&gt;GitHub&lt;/a&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;ou faça o download no&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;https://drive.google.com/file/d/0B7sttJEXxZumaXdfeXlocnZ4SGs/view?usp=sharing&quot; style=&quot;font-family: arial, helvetica, sans-serif;&quot; target=&quot;_blank&quot;&gt;Google Drive&lt;/a&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot;;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Este procedimento é útil quando queremos ter uma cópia de uma tabela, antes de executarmos alguma alteração, como por exemplo um update e quisermos manter uma cópia da tabela original.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Este post é dividido em cinco partes:&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;1ª parte: damos um exemplo de como criar a tabela &quot;tb_paciente&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;2ª parte: vamos criar a tabela &quot;tb_paciente_bkp&quot; &amp;nbsp;a partir &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;da tabela &quot;tb_paciente&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;3ª parte: vamos criar a tabela&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&quot;tb_paciente_bkp_altera_col&quot; a partir da&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;tabela &quot;tb_paciente&quot;, a nova tabela terá o nome das colunas diferentes das colunas da tabela original.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;4ª parte: vamos criar a tabela &quot;tb_paciente_bkp_filt&quot; &amp;nbsp;a partir&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;da tabela &quot;tb_paciente&quot;, mas vamos incluir apenas alguns registros da tabela original, ou seja, vamos utilizar um filtro.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;5ª parte: vamos criar a tabela &quot;tb_paciente_bkp_col&quot; &amp;nbsp;a partir&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;da tabela &quot;tb_paciente&quot;, mas vamos incluir na nova tabela apenas algumas colunas da tabela original.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&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;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;79&quot; data-original-width=&quot;384&quot; height=&quot;80&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqaXY5HsxCWNtNuE86f43-DKHyOHmotSIPe9PtQQCX39IEGL87o5Q3XGdhFSoX2dCA3RumddRa8nmLYHWbqzeUrDA1aFiAaCeEyV-cmvFSuOs8rFh9aIgQ71TdvjhfyUhUIWD20gjj3Lk/s400/tb_paciente.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot; width=&quot;400&quot; /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Tabela: tb_paciente&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;1ª parte&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;➧ Caso queira criar esta tabela no seu banco de dados, segue o script da criação da tabela:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;CREATE TABLE tb_paciente&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;(&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; prontuario int IDENTITY(1,1) PRIMARY KEY,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; nome varchar(255) NOT NULL ,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; data_nasc date NOT NULL ,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; sexo character(1) NOT NULL ,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; peso numeric(6,3),&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; proc_cirurgico bit NOT NULL&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;➧ Para incluir os registros na tabela &quot;tb_paciente&quot; utilize o comando INSERT:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;INSERT INTO tb_paciente (nome, data_nasc, sexo, peso, proc_cirurgico)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;VALUES (&#39;Maria Santos&#39;, &#39;1984-04-20&#39;, &#39;f&#39;, 52.440, 1);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;INSERT INTO tb_paciente(nome, data_nasc, sexo, peso, proc_cirurgico)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;VALUES (&#39;João Silva&#39;, &#39;1974-08-29&#39;, &#39;m&#39;, 80.520 , 0);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;INSERT INTO tb_paciente(nome , data_nasc , sexo , peso , proc_cirurgico)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;VALUES(&#39;Ana Moraes&#39;, &#39;1982-10-30&#39;, &#39;f&#39;, 57.700, 1);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;➧ Para visualizar os registros na tabela &quot;tb_paciente&quot; utilize o comando SELECT:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;SELECT&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; prontuario ,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; nome ,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; data_nasc ,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; sexo ,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; peso ,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; proc_cirurgico&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;FROM tb_paciente;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;2ª parte&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Agora, vamos criar a cópia desta tabela.&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;A sentença SQL abaixo, cria a cópia da tabela &quot;tb_paciente&quot;. Esta nova tabela se chamará &quot;tb_paciente_bkp&amp;nbsp;&quot;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;&lt;b&gt;SELECT &amp;nbsp;* &amp;nbsp;INTO&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;b&gt;tb_paciente_bkp &amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;FROM &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;tb_paciente&lt;/span&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Repare que nosso exemplo segue a sintaxe:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #20124d;&quot;&gt;&lt;b&gt;SELECT &amp;nbsp;* &amp;nbsp;INTO&lt;/b&gt;&lt;/span&gt; &lt;span style=&quot;color: #274e13;&quot;&gt;&lt;b&gt;nova_tabela &amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;FROM &amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;b style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;tabela_original&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;color: red; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Importante!!!&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Se o nome atribuído&amp;nbsp;a nova tabela já existir no banco de dados, será exibida a mensagem de erro abaixo, e a cópia da tabela não será criada.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #134f5c; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;Mensagem 2714, Nível 16, Estado 6&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #134f5c; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;Já existe um objeto com nome &#39;tb_paciente_bkp&#39; no banco de dados.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #134f5c; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: #134f5c; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;Para corrigir este erro, troque o nome da nova tabela.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #134f5c; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;➧ Para visualizar os registros na tabela &quot;tb_paciente_bkp&quot; utilize o comando SELECT:&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #134f5c; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;color: #073763; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;SELECT * FROM tb_paciente_bkp&lt;span style=&quot;color: #20124d;&quot;&gt;;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Veja abaixo o resultado da nova tabela:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHM0vZfr_Mw2kyxwH8GFmmxjQw8QJVP95-MsyNeM29zmoPZi0OVSMpa0QHcM2aE6yTogjoNYRAisAkbrZ-YQs8BR_-c-JXVgj7Qs76Q_3uSo17xw8nK9MYCfnHCg2w0-HRCNq4MmSg41Q/s1600/tb_paciente.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;79&quot; data-original-width=&quot;384&quot; height=&quot;81&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHM0vZfr_Mw2kyxwH8GFmmxjQw8QJVP95-MsyNeM29zmoPZi0OVSMpa0QHcM2aE6yTogjoNYRAisAkbrZ-YQs8BR_-c-JXVgj7Qs76Q_3uSo17xw8nK9MYCfnHCg2w0-HRCNq4MmSg41Q/s400/tb_paciente.png&quot; width=&quot;400&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Tabela: tb_paciente_bkp&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;Observe na imagem abaixo &amp;nbsp;a nova tabela criada.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjh6WpkApGoukRokmabBAnEyZu6q94SGt0rdmQDPNjbHf7LwFvJq459ECx33_A3S8nh83Xsta7uUR9vn1ShWBhpqiyn49qR7QCcuqi3HaeBZHiIpFpUERwgYLJzJHfR08rYUMFqxrSDfQ/s1600/criar+c%25C3%25B3pia+de+tabela+no+sql+server.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;250&quot; data-original-width=&quot;261&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjh6WpkApGoukRokmabBAnEyZu6q94SGt0rdmQDPNjbHf7LwFvJq459ECx33_A3S8nh83Xsta7uUR9vn1ShWBhpqiyn49qR7QCcuqi3HaeBZHiIpFpUERwgYLJzJHfR08rYUMFqxrSDfQ/s1600/criar+c%25C3%25B3pia+de+tabela+no+sql+server.png&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Veja a cópia da tabela criada no banco de dados&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b style=&quot;font-family: arial, helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;3ª parte&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b style=&quot;font-family: arial, helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;b style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;color: black; font-weight: normal;&quot;&gt;Existe a possibilidade de alterar o nome das colunas da nova tabela utilizando &quot;&lt;/span&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;AS&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: normal;&quot;&gt;&quot;. Veja a sentença abaixo:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b style=&quot;color: #20124d;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b style=&quot;color: #20124d; font-family: arial, helvetica, sans-serif;&quot;&gt;SELECT&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; prontuario &amp;nbsp;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #0c343d;&quot;&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;AS&lt;/span&gt;&lt;span style=&quot;color: #0c343d; font-weight: normal;&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;pac_prontuario,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; nome &amp;nbsp;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;AS&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&amp;nbsp; pac_nome,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; data_nasc &amp;nbsp;&amp;nbsp;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;AS&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&amp;nbsp; pac_&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;data_nasc&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; sexo &amp;nbsp;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;AS&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&amp;nbsp; pac_sexo,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; peso &amp;nbsp;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;AS&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&amp;nbsp; pac_peso,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; proc_cirurgico &amp;nbsp;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;AS&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&amp;nbsp; pac_&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;proc_cirurgico&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #20124d; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;INTO&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #274e13; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;tb_paciente_bkp_altera_col&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #274e13; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;FROM &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;tb_paciente&lt;/span&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #274e13; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4E49mCW55QLVhSBV1Pb9laVBuvdSNrUEsKHATPdOCMpHMYx3MDkZHtCeCGQG-h95FX9avZs-GBuO8K4-Q7DHHItgWNlJOFktftp38JY2LJ8dvyt6kjKkp3m7THCcLtABZ5hzI6-iRiXw/s1600/select_into_mudar_nome_coluna.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;95&quot; data-original-width=&quot;516&quot; height=&quot;72&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4E49mCW55QLVhSBV1Pb9laVBuvdSNrUEsKHATPdOCMpHMYx3MDkZHtCeCGQG-h95FX9avZs-GBuO8K4-Q7DHHItgWNlJOFktftp38JY2LJ8dvyt6kjKkp3m7THCcLtABZ5hzI6-iRiXw/s400/select_into_mudar_nome_coluna.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Tabela: tb_paciente_bkp_altera_col&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;color: #274e13; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b style=&quot;color: #741b47;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Após a execução da sentença, será criada uma nova tabela chamada &lt;span style=&quot;color: #741b47;&quot;&gt;&amp;nbsp;&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;tb_paciente_bkp_altera_col&quot;, essa tabela terá o nome das colunas diferente das colunas da tabela de origem &lt;/span&gt;&lt;b style=&quot;color: #741b47;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;tb_paciente&quot;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;4ª parte&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Existe a possibilidade de criar uma nova tabela, apena com alguns registros da tabela original, para isso utilizaremos um filtro, representado pelo comando &quot;&lt;b style=&quot;color: #274e13;&quot;&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;WHERE&lt;/span&gt;&lt;/b&gt;&quot;.&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Vamos criar a tabela &quot;tb_paciente_bkp_filt&quot;, &amp;nbsp;a partir&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;da tabela &quot;tb_paciente&quot;, e vamos filtrar os pacientes somente do sexo feminino, &amp;nbsp;ou seja,&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #274e13; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;sexo =&amp;nbsp;&lt;span style=&quot;color: #660000;&quot;&gt;&lt;b&gt;&#39;f&#39;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;b style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Veja a sentença abaixo:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;b style=&quot;color: #20124d; font-family: arial, helvetica, sans-serif;&quot;&gt;SELECT&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; prontuario,&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; nome,&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; data_nasc&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; sexo,&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; peso,&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; proc_cirurgico&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #20124d; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;INTO&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #274e13; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;tb_paciente_bkp_filt &amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #274e13; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;FROM &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;tb_paciente&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #274e13; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;WHERE &amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;sexo = &lt;span style=&quot;color: #660000;&quot;&gt;&lt;b&gt;&#39;f&#39;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;b style=&quot;color: #274e13; font-family: arial, helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b style=&quot;color: #274e13; font-family: arial, helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Após a execução da sentença, será criada uma nova tabela.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;Veja a imagem abaixo:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5k_qd70WSp9O70ReGP6lnVYxXNfaH1J38NT4Fyu1pM3t6N2Ah0Tx4KcBmsRTwFxt9rARIjzbd1_r2ZR5yKa8ZIo0EBMvw4U9WgmACXugZ6qw2fPj82FKd6NUEK8u2BoPT2mTNmGGjyqg/s1600/select_into_filtrar_registros.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;56&quot; data-original-width=&quot;385&quot; height=&quot;57&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5k_qd70WSp9O70ReGP6lnVYxXNfaH1J38NT4Fyu1pM3t6N2Ah0Tx4KcBmsRTwFxt9rARIjzbd1_r2ZR5yKa8ZIo0EBMvw4U9WgmACXugZ6qw2fPj82FKd6NUEK8u2BoPT2mTNmGGjyqg/s400/select_into_filtrar_registros.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Tabela: tb_paciente_bkp_filt&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;b style=&quot;color: #741b47;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;5ª parte&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;b style=&quot;color: #741b47;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Existe a possibilidade de criar uma nova tabela, apena com algumas colunas da tabela original, para isso, colocaremos apenas as colunas desejadas, após o comando &quot;SELECT&quot;.&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Vamos criar a tabela &quot;tb_paciente_bkp_col&quot;, &amp;nbsp;a partir&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;da tabela &quot;tb_paciente&quot;, apenas com algumas colunas da tabela original. Neste caso, vamos escolher as colunas: &quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;prontuario&quot;, &quot;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;nome&quot; e &quot;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;peso&quot;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Veja a sentença abaixo:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b style=&quot;color: #20124d; font-family: arial, helvetica, sans-serif;&quot;&gt;SELECT&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; prontuario,&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; nome,&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; peso&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #20124d; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;INTO&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #274e13; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;tb_paciente_bkp_col &amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #274e13; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;FROM &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;tb_paciente&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;color: #274e13; font-family: arial, helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b style=&quot;color: #274e13; font-family: arial, helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b style=&quot;color: #274e13; font-family: arial, helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;&lt;b style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Após a execução da sentença, será criada uma nova tabela.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-weight: normal;&quot;&gt;&amp;nbsp;Veja a imagem abaixo:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpe1WhB1syN3VMSwWZ1IWpyF-X4m9F7cg2NQx2wIpibcZHwxJBGFV5w3Vq9jhkEIoIPxCymL1x4lUUvMpK-l-8SCmH1qLiplL5sVdn6EJh2cV3Uu-c8VFB1akAQ-V-l-w3DKKR2UiiQ8c/s1600/select_into_selecionar_apenas_algumas_colunas.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;75&quot; data-original-width=&quot;194&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpe1WhB1syN3VMSwWZ1IWpyF-X4m9F7cg2NQx2wIpibcZHwxJBGFV5w3Vq9jhkEIoIPxCymL1x4lUUvMpK-l-8SCmH1qLiplL5sVdn6EJh2cV3Uu-c8VFB1akAQ-V-l-w3DKKR2UiiQ8c/s1600/select_into_selecionar_apenas_algumas_colunas.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Tabela: tb_paciente_bkp_col&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;b style=&quot;color: #741b47;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b style=&quot;color: #741b47;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Deixe o seu comentário ou sugestão.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;b&gt;Gostou?&amp;nbsp; Siga no Google + ou Facebook&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;b&gt;.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://jquerydicas.blogspot.com/feeds/4616432602006367723/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://jquerydicas.blogspot.com/2017/06/copiar-dados-de-uma-tabela-para-uma.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/4616432602006367723'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/4616432602006367723'/><link rel='alternate' type='text/html' href='http://jquerydicas.blogspot.com/2017/06/copiar-dados-de-uma-tabela-para-uma.html' title='Criar uma tabela no SQL SERVER  a partir de uma tabela existente'/><author><name>Kelly</name><uri>http://www.blogger.com/profile/03449060135636479990</uri><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/AVvXsEgqaXY5HsxCWNtNuE86f43-DKHyOHmotSIPe9PtQQCX39IEGL87o5Q3XGdhFSoX2dCA3RumddRa8nmLYHWbqzeUrDA1aFiAaCeEyV-cmvFSuOs8rFh9aIgQ71TdvjhfyUhUIWD20gjj3Lk/s72-c/tb_paciente.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7010404629734647455.post-2692708425333365157</id><published>2015-05-01T16:12:00.000-03:00</published><updated>2015-05-01T16:16:00.725-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="formatar string postgresql"/><category scheme="http://www.blogger.com/atom/ns#" term="formatação postgresql"/><category scheme="http://www.blogger.com/atom/ns#" term="funções de manipulação de string"/><category scheme="http://www.blogger.com/atom/ns#" term="postgresql"/><category scheme="http://www.blogger.com/atom/ns#" term="REGEXP_REPLACE"/><title type='text'>Postgresql - Formatar CNPJ com REGEXP_REPLACE</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Neste artigo, vamos mostrar um exemplo de como utilizar a função REGEXP_REPLACE para formatar o CNPJ.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Caso tenha interesse, veja o script no &lt;a href=&quot;https://github.com/kellysc2013/dicas_sql_jquery/blob/master/artigo_postgresql_regexp_replace_cnpj/artigo_postgresql_regexp_replace_cnpj.sql&quot; target=&quot;_blank&quot;&gt;github&lt;/a&gt;&amp;nbsp;ou&amp;nbsp;faça o &lt;a href=&quot;https://drive.google.com/open?id=0B7sttJEXxZumM3VnSWFZT3RyeFk&amp;amp;authuser=0&quot; target=&quot;_blank&quot;&gt;download&lt;/a&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;1º Exemplo&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Para formatar o CNPJ vamos utilizar a tabela &quot;tb_cadastro&quot;, exibida na imagem a seguir:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&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/AVvXsEhFHfbtXXoOkyvByu0AVMh5FRtYffo_sDLFDfLGhCDT0EGnejqsvKkkyh-yViX_jhcBm80CP5WS_LV1oPE2n5IGe4OUlhTyVudf1FpyKIeV5UCpbcN5UDdhT2imoSkPsdo4usJXU8j3xUk/s1600/regexp_replace_cnpj_tb_cadastro.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFHfbtXXoOkyvByu0AVMh5FRtYffo_sDLFDfLGhCDT0EGnejqsvKkkyh-yViX_jhcBm80CP5WS_LV1oPE2n5IGe4OUlhTyVudf1FpyKIeV5UCpbcN5UDdhT2imoSkPsdo4usJXU8j3xUk/s1600/regexp_replace_cnpj_tb_cadastro.png&quot; height=&quot;84&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&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;
&amp;nbsp;&lt;b style=&quot;font-size: x-large;&quot;&gt;Solução&lt;/b&gt;&lt;br /&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;&quot;&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: left;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeQ5ScfC7bCmk5oALEIWNElzjoiBLrrypFY6FvBu7ie5YnfWhrrWzMnRW4MSfXTNCGpYUSXwAc4XkCbW5J3MNXukSPezKj0VI2liTtZQpziZJqIlR-HK7IKYzQMT4XWFyg6or5MO5uL9Q/s1600/regexp_replace_cnpj.png&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; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeQ5ScfC7bCmk5oALEIWNElzjoiBLrrypFY6FvBu7ie5YnfWhrrWzMnRW4MSfXTNCGpYUSXwAc4XkCbW5J3MNXukSPezKj0VI2liTtZQpziZJqIlR-HK7IKYzQMT4XWFyg6or5MO5uL9Q/s1600/regexp_replace_cnpj.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&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: left;&quot;&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Observe que na função REGEXP_REPLACE:&lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: &#39;Times New Roman&#39;; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Utiliza-se parenteses &quot;&lt;b&gt;( )&lt;/b&gt;&quot; para separar cada parte da string, neste caso o CNPJ;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Utiliza-se&amp;nbsp;&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;b&gt;\d&lt;/b&gt;&quot; para representar os digitos de &quot;0&quot; até &quot;9&quot;&lt;/span&gt;&lt;/b&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Dentro das chaves &quot;&lt;b&gt;{}&lt;/b&gt;&quot; deve ser colocado a quantidade&amp;nbsp;de dígitos que vamos utilizar em cada parte;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Utiliza-se&lt;/span&gt;&lt;/b&gt;&amp;nbsp;contra-barra &quot;&lt;b&gt;\&lt;/b&gt;&quot; antes de cada parte criada;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Após a execução da sentença, teremos o seguinte resultado:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&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/AVvXsEhucjwqXmpIXCDmHPrSmG3Cg1augdLtOtMbvIJhfFeR8GfPJgGK4qi1Yo2rpqVMwL0zjzY3E7SLnZeVZYHM-REANKFmDqWjrPVFPBTCkXy8upIO2rMUIrFgBISKY50zDHK8DbC_RT-TcjI/s1600/regexp_replace_cnpj_result.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhucjwqXmpIXCDmHPrSmG3Cg1augdLtOtMbvIJhfFeR8GfPJgGK4qi1Yo2rpqVMwL0zjzY3E7SLnZeVZYHM-REANKFmDqWjrPVFPBTCkXy8upIO2rMUIrFgBISKY50zDHK8DbC_RT-TcjI/s1600/regexp_replace_cnpj_result.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&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: left;&quot;&gt;
Veja também:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;a href=&quot;http://jquerydicas.blogspot.com.br/2015/04/postgresql-formatar-cep-com.html&quot; target=&quot;_blank&quot;&gt;PostgreSql - Formatar CEP com REGEXP_REPLACE&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;a href=&quot;http://jquerydicas.blogspot.com.br/2015/04/postgresql-formatar-cpf-com.html&quot; target=&quot;_blank&quot;&gt;PostgreSql - Formatar CPF com REGEXP_REPLACE&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;b style=&quot;color: #741b47; font-family: Arial, Helvetica, sans-serif;&quot;&gt;Deixe o seu comentário ou sugestão.&lt;/b&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;b&gt;Gostou?&amp;nbsp; Siga no Google +&amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: small;&quot;&gt;ou Facebook&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;.&lt;/b&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://jquerydicas.blogspot.com/feeds/2692708425333365157/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://jquerydicas.blogspot.com/2015/05/postgresql-formatar-cnpj-com.html#comment-form' title='1 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/2692708425333365157'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/2692708425333365157'/><link rel='alternate' type='text/html' href='http://jquerydicas.blogspot.com/2015/05/postgresql-formatar-cnpj-com.html' title='Postgresql - Formatar CNPJ com REGEXP_REPLACE'/><author><name>Kelly</name><uri>http://www.blogger.com/profile/03449060135636479990</uri><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/AVvXsEhFHfbtXXoOkyvByu0AVMh5FRtYffo_sDLFDfLGhCDT0EGnejqsvKkkyh-yViX_jhcBm80CP5WS_LV1oPE2n5IGe4OUlhTyVudf1FpyKIeV5UCpbcN5UDdhT2imoSkPsdo4usJXU8j3xUk/s72-c/regexp_replace_cnpj_tb_cadastro.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7010404629734647455.post-1562747841235281452</id><published>2015-04-18T16:46:00.002-03:00</published><updated>2015-05-01T16:12:36.415-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="formatar string postgresql"/><category scheme="http://www.blogger.com/atom/ns#" term="formatação postgresql"/><category scheme="http://www.blogger.com/atom/ns#" term="funções de manipulação de string"/><category scheme="http://www.blogger.com/atom/ns#" term="postgresql"/><category scheme="http://www.blogger.com/atom/ns#" term="REGEXP_REPLACE"/><title type='text'>Postgresql - Formatar CPF com REGEXP_REPLACE</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Neste artigo, vamos mostrar 3 exemplos de como utilizar a função REGEXP_REPLACE para formatar o CPF.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Veja qual o exemplo é mais fácil para você, eu considero o 3º exemplo o mais fácil de ser utilizado.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Caso tenha interesse, veja o script no &lt;a href=&quot;https://github.com/kellysc2013/dicas_sql_jquery/blob/master/artigo_postgresql_regexp_replace_cpf/artigo_postgresql_regexp_replace_cpf.sql&quot; target=&quot;_blank&quot;&gt;github&lt;/a&gt;, faça o &lt;a href=&quot;https://drive.google.com/open?id=0B7sttJEXxZumdDF5Z1dtVHdqQjA&amp;amp;authuser=0&quot; target=&quot;_blank&quot;&gt;download&lt;/a&gt; ou execute no &lt;a href=&quot;http://sqlfiddle.com/#!15/ddd53/4&quot; target=&quot;_blank&quot;&gt;Sqlfiddle&lt;/a&gt;:&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;1º Exemplo&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Para formatar o CPF vamos utilizar a tabela &quot;tb_alunos&quot;, exibida na imagem a seguir:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&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/AVvXsEjzPN0hrd5nXQrKT0PRZdwaKpdZSPtu5E0ozlhbekCj_zY-I-9k9pHwuKAXi8_lG7Q9eXad9R8GMQl5vVccEHwVjkFHa1oUjMMxcZVwAxDF71_zDgvBmINzRFAe8QdQqK1hTOFRdYH-z4I/s1600/postgresql_regexp_replace_tabela_alunos.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzPN0hrd5nXQrKT0PRZdwaKpdZSPtu5E0ozlhbekCj_zY-I-9k9pHwuKAXi8_lG7Q9eXad9R8GMQl5vVccEHwVjkFHa1oUjMMxcZVwAxDF71_zDgvBmINzRFAe8QdQqK1hTOFRdYH-z4I/s1600/postgresql_regexp_replace_tabela_alunos.png&quot; height=&quot;84&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&amp;nbsp;&lt;b style=&quot;font-size: x-large;&quot;&gt;Solução&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQiKqwtgLlzgZo-7YIvmb-jcm5xLaS2bVOlpwIAJ1ZUmCf6POa83xgSrt8yubDOpB0unEpKB0_xtNdu5fBSupkw1-lAx2mX1Rc_AE0-5MQEY7BXEcYPbwsx4zwgAog1cR1PB9mDJDc-FQ/s1600/postgresql_regexp_replace_ex_cpf.png&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; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQiKqwtgLlzgZo-7YIvmb-jcm5xLaS2bVOlpwIAJ1ZUmCf6POa83xgSrt8yubDOpB0unEpKB0_xtNdu5fBSupkw1-lAx2mX1Rc_AE0-5MQEY7BXEcYPbwsx4zwgAog1cR1PB9mDJDc-FQ/s1600/postgresql_regexp_replace_ex_cpf.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;b style=&quot;font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&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: left;&quot;&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Observe que na função REGEXP_REPLACE:&lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: &#39;Times New Roman&#39;; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Utilizamos parenteses &quot;&lt;b&gt;( )&lt;/b&gt;&quot; para separar cada parte da string, neste caso o CPF;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Utilizamos colchetes &amp;nbsp;&amp;nbsp;&quot;&lt;/span&gt;[ ]&lt;span style=&quot;font-weight: normal;&quot;&gt;&quot; para indicar quais os caracteres que iremos utilizar em cada parte, neste caso utilizamos caracteres numéricos de &quot;0&quot; até &quot;9&quot;, representados pela expressão&amp;nbsp;&lt;/span&gt;0-9&lt;/b&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Indicamos dentro das chaves &quot;&lt;b&gt;{}&lt;/b&gt;&quot; a quantidade&amp;nbsp;de dígitos que vamos utilizar;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Utilizamos contra-barra &quot;&lt;b&gt;\&lt;/b&gt;&quot; antes de cada parte criada;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Após a execução da sentença, teremos o seguinte resultado:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&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/AVvXsEiGn_5myB3av1rO2VwjEsi74UB3JMppfK_HaSR6G2pahLi1IqvP9w1h7RO5UcWJid8CielrAA9TNuHNEy3o05kn4R9q3HQ1GxwAQm0z4COJ3Q3xOzoXKPDZb-0AjAlSzhtTgt8Eho52pAg/s1600/postgresql_regexp_replace_result_cpf_formatado.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGn_5myB3av1rO2VwjEsi74UB3JMppfK_HaSR6G2pahLi1IqvP9w1h7RO5UcWJid8CielrAA9TNuHNEy3o05kn4R9q3HQ1GxwAQm0z4COJ3Q3xOzoXKPDZb-0AjAlSzhtTgt8Eho52pAg/s1600/postgresql_regexp_replace_result_cpf_formatado.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&amp;nbsp;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;2&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;º Exemplo&lt;/span&gt;&lt;/b&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;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Também podemos substituir a expressão &quot;&lt;b&gt;0-9&lt;/b&gt;&quot;&lt;b&gt;&amp;nbsp;&lt;/b&gt;que&amp;nbsp;indica a utilização de caracteres numéricos de 0 até 9,&lt;b&gt;&amp;nbsp;&lt;/b&gt;pela expressão &lt;b&gt;[:digit:]&lt;/b&gt;. O resultado será o mesmo.&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b style=&quot;font-size: x-large;&quot;&gt;Solução&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&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/AVvXsEhEGQYeckljJRNsbpx7zBkKraskgbVmXOzBkJ-pKmbQbD6Ws2cmdkeYQh_OZOoTRbHL3n7SfBHXZHfK1buYsLLe7bpbDSKj_Ld03EDpmooFbns8j9oCE_WhwKffahORaMihvJ4yy0aT1VM/s1600/postgresql_regexp_replace_ex_2_cpf.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em; text-align: left;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEGQYeckljJRNsbpx7zBkKraskgbVmXOzBkJ-pKmbQbD6Ws2cmdkeYQh_OZOoTRbHL3n7SfBHXZHfK1buYsLLe7bpbDSKj_Ld03EDpmooFbns8j9oCE_WhwKffahORaMihvJ4yy0aT1VM/s1600/postgresql_regexp_replace_ex_2_cpf.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&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: left;&quot;&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: left;&quot;&gt;
Após a execução da sentença, teremos o seguinte resultado:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&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/AVvXsEiGn_5myB3av1rO2VwjEsi74UB3JMppfK_HaSR6G2pahLi1IqvP9w1h7RO5UcWJid8CielrAA9TNuHNEy3o05kn4R9q3HQ1GxwAQm0z4COJ3Q3xOzoXKPDZb-0AjAlSzhtTgt8Eho52pAg/s1600/postgresql_regexp_replace_result_cpf_formatado.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGn_5myB3av1rO2VwjEsi74UB3JMppfK_HaSR6G2pahLi1IqvP9w1h7RO5UcWJid8CielrAA9TNuHNEy3o05kn4R9q3HQ1GxwAQm0z4COJ3Q3xOzoXKPDZb-0AjAlSzhtTgt8Eho52pAg/s1600/postgresql_regexp_replace_result_cpf_formatado.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&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&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;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;3º Exemplo&lt;/span&gt;&lt;/b&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;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
Para facilitar, podemos substituir a expressão &quot;&lt;b&gt;[&lt;/b&gt;&lt;b&gt;[:digit:]&lt;/b&gt;&lt;b&gt;]&lt;/b&gt;&quot;&lt;b&gt;&amp;nbsp;&lt;/b&gt;que&amp;nbsp;indica a utilização de caracteres numéricos de 0 até 9,&lt;b&gt;&amp;nbsp;&lt;/b&gt;pela expressão abreviada&amp;nbsp;&lt;b&gt;&quot;\d&quot;&lt;/b&gt;. O resultado será o mesmo.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;b style=&quot;font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;b style=&quot;font-size: x-large;&quot;&gt;Solução&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;b style=&quot;font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/b&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/AVvXsEjYp_4K-4X2VSc2d-qY3QRmcgAK2cTFDgk6aVRAL223rRwVqbfbIfV5OprAZCFZKxnr15RQywljK-17BVmWE5ga341zBLxgyePGs5kpF0IwKtgXl6QkuFjwvkB8OYm0Jblg7POfmF9HmCo/s1600/postgresql_regexp_replace_ex_3_cpf.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYp_4K-4X2VSc2d-qY3QRmcgAK2cTFDgk6aVRAL223rRwVqbfbIfV5OprAZCFZKxnr15RQywljK-17BVmWE5ga341zBLxgyePGs5kpF0IwKtgXl6QkuFjwvkB8OYm0Jblg7POfmF9HmCo/s1600/postgresql_regexp_replace_ex_3_cpf.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;b style=&quot;font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&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 class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
Após a execução da sentença, teremos o seguinte resultado:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&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/AVvXsEiGn_5myB3av1rO2VwjEsi74UB3JMppfK_HaSR6G2pahLi1IqvP9w1h7RO5UcWJid8CielrAA9TNuHNEy3o05kn4R9q3HQ1GxwAQm0z4COJ3Q3xOzoXKPDZb-0AjAlSzhtTgt8Eho52pAg/s1600/postgresql_regexp_replace_result_cpf_formatado.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGn_5myB3av1rO2VwjEsi74UB3JMppfK_HaSR6G2pahLi1IqvP9w1h7RO5UcWJid8CielrAA9TNuHNEy3o05kn4R9q3HQ1GxwAQm0z4COJ3Q3xOzoXKPDZb-0AjAlSzhtTgt8Eho52pAg/s1600/postgresql_regexp_replace_result_cpf_formatado.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;b style=&quot;color: #741b47; font-family: Arial, Helvetica, sans-serif;&quot;&gt;Deixe o seu comentário ou sugestão.&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;b&gt;Gostou?&amp;nbsp; Siga no Google +&amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: small;&quot;&gt;ou Facebook&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;.&lt;/b&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://jquerydicas.blogspot.com/feeds/1562747841235281452/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://jquerydicas.blogspot.com/2015/04/postgresql-formatar-cpf-com.html#comment-form' title='4 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/1562747841235281452'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/1562747841235281452'/><link rel='alternate' type='text/html' href='http://jquerydicas.blogspot.com/2015/04/postgresql-formatar-cpf-com.html' title='Postgresql - Formatar CPF com REGEXP_REPLACE'/><author><name>Kelly</name><uri>http://www.blogger.com/profile/03449060135636479990</uri><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/AVvXsEjzPN0hrd5nXQrKT0PRZdwaKpdZSPtu5E0ozlhbekCj_zY-I-9k9pHwuKAXi8_lG7Q9eXad9R8GMQl5vVccEHwVjkFHa1oUjMMxcZVwAxDF71_zDgvBmINzRFAe8QdQqK1hTOFRdYH-z4I/s72-c/postgresql_regexp_replace_tabela_alunos.png" height="72" width="72"/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7010404629734647455.post-5179150401035710671</id><published>2015-04-11T16:27:00.000-03:00</published><updated>2015-04-25T17:05:16.223-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="formatar string postgresql"/><category scheme="http://www.blogger.com/atom/ns#" term="formatação postgresql"/><category scheme="http://www.blogger.com/atom/ns#" term="funções de manipulação de string"/><category scheme="http://www.blogger.com/atom/ns#" term="REGEXP_REPLACE"/><title type='text'>Postgresql - Formatar CEP com REGEXP_REPLACE</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Neste artigo, vamos mostrar 3 exemplos de como utilizar a função REGEXP_REPLACE para formatar CEP.&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Veja qual a forma é mais simples para você, eu considero a do 3º exemplo.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Caso tenha interesse, veja o script no &lt;a href=&quot;https://github.com/kellysc2013/dicas_sql_jquery/blob/master/artigo_postgresql_regexp_replace/artigo_postgresql_regexp_replace.sql&quot; target=&quot;_blank&quot;&gt;github&lt;/a&gt;, faça o &lt;a href=&quot;https://drive.google.com/open?id=0B7sttJEXxZumQzR5LXFMT3N1c2c&amp;amp;authuser=0&quot; target=&quot;_blank&quot;&gt;download&lt;/a&gt; ou execute no &lt;a href=&quot;http://sqlfiddle.com/#!15/43e14/7&quot; target=&quot;_blank&quot;&gt;Sqlfiddle&lt;/a&gt;:&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;1º Exemplo&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Para formatar o CEP vamos utilizar a tabela &quot;tb_endereco&quot;, exibida na imagem a seguir:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&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/AVvXsEiTUzGriOmBfWEijvTKNMefAJVBWl6enPUFOr3bBBX89HkE-_X1IcvYvLgH311duTtbOhIpk4KNQOCv4mwNMdI73Q_RwVH_j6rMXuaB4plPNwi6-6A7q8mDrF-jWh3MvGUfUw99mtWNx8M/s1600/artigo_regexp_replace_tb_endereco.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTUzGriOmBfWEijvTKNMefAJVBWl6enPUFOr3bBBX89HkE-_X1IcvYvLgH311duTtbOhIpk4KNQOCv4mwNMdI73Q_RwVH_j6rMXuaB4plPNwi6-6A7q8mDrF-jWh3MvGUfUw99mtWNx8M/s1600/artigo_regexp_replace_tb_endereco.png&quot; height=&quot;86&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b style=&quot;font-size: x-large;&quot;&gt;Solução&lt;/b&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/AVvXsEimMsuLLiMFuhl1u-PNyOiNEALU_2Sskgw0n-qKXWIycNOZLSazZAGjGpDDAPNXOx15iNII9Q991qFtFp1KcNMnWNl7aeHQL4NLVUq8sd16nENpSBrjEq_nT8jZ20HbzX4cdMuckDTFmTs/s1600/artigo_regexp_replace_cep_ex_1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimMsuLLiMFuhl1u-PNyOiNEALU_2Sskgw0n-qKXWIycNOZLSazZAGjGpDDAPNXOx15iNII9Q991qFtFp1KcNMnWNl7aeHQL4NLVUq8sd16nENpSBrjEq_nT8jZ20HbzX4cdMuckDTFmTs/s1600/artigo_regexp_replace_cep_ex_1.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&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: left;&quot;&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Observe que na função REGEXP_REPLACE:&lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: &#39;Times New Roman&#39;; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Utilizamos parenteses &quot;&lt;b&gt;( )&lt;/b&gt;&quot; para separar cada parte da string, neste caso o CEP;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Utilizamos colchetes &amp;nbsp;&amp;nbsp;&quot;&lt;/span&gt;[ ]&lt;span style=&quot;font-weight: normal;&quot;&gt;&quot; para indicar quais os caracteres que iremos utilizar em cada parte, neste caso utilizamos caracteres numéricos de &quot;0&quot; até &quot;9&quot;, representados pela expressão&amp;nbsp;&lt;/span&gt;0-9&lt;/b&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Indicamos dentro das chaves &quot;&lt;b&gt;{}&lt;/b&gt;&quot; a quantidade&amp;nbsp;de dígitos que vamos utilizar;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Utilizamos contra-barra &quot;&lt;b&gt;\&lt;/b&gt;&quot; antes de cada parte criada;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Após a execução da sentença, teremos o seguinte resultado:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&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/AVvXsEg99QQWSqOaSF4n9JAREU0er0S7gNJCWeKaynmttYbVkuXKn0bTYdKXwJd0YYclx3FdzeOAESFnGkvzL4FWkaIzwTTykPg2id5InXQKQPMdEENBW7Rys35hjciEEpWGevvb5qsfe9EJ1kY/s1600/artigo_regexp_replace_cep_formatado.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg99QQWSqOaSF4n9JAREU0er0S7gNJCWeKaynmttYbVkuXKn0bTYdKXwJd0YYclx3FdzeOAESFnGkvzL4FWkaIzwTTykPg2id5InXQKQPMdEENBW7Rys35hjciEEpWGevvb5qsfe9EJ1kY/s1600/artigo_regexp_replace_cep_formatado.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&amp;nbsp;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;2&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;º Exemplo&lt;/span&gt;&lt;/b&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;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Podemos substituir a expressão &quot;&lt;b&gt;0-9&lt;/b&gt;&quot;&lt;b&gt;&amp;nbsp;&lt;/b&gt;que&amp;nbsp;indica a utilização de caracteres numéricos de 0 até 9,&lt;b&gt;&amp;nbsp;&lt;/b&gt;pela expressão &quot;&lt;b&gt;[:digit:]&quot;&lt;/b&gt;. O resultado será o mesmo.&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b style=&quot;font-size: x-large;&quot;&gt;Solução&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&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/AVvXsEisyAUxgd-wSDTJ1AvUUXcwGw1GJkAH2YilaFWWHHyvT800Dm-zEfnu2X9IVjZV7nC3ZaaG4xZsFyrsUwJe_AazvfP8gl-6x8oPdpdX0R2JgSI5brJp8RwSPezPi0zmwFzGUwLXQwRxBls/s1600/artigo_regexp_replace_cep_ex_2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisyAUxgd-wSDTJ1AvUUXcwGw1GJkAH2YilaFWWHHyvT800Dm-zEfnu2X9IVjZV7nC3ZaaG4xZsFyrsUwJe_AazvfP8gl-6x8oPdpdX0R2JgSI5brJp8RwSPezPi0zmwFzGUwLXQwRxBls/s1600/artigo_regexp_replace_cep_ex_2.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&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: left;&quot;&gt;
Após a execução da sentença, teremos o seguinte resultado:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&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&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/AVvXsEg99QQWSqOaSF4n9JAREU0er0S7gNJCWeKaynmttYbVkuXKn0bTYdKXwJd0YYclx3FdzeOAESFnGkvzL4FWkaIzwTTykPg2id5InXQKQPMdEENBW7Rys35hjciEEpWGevvb5qsfe9EJ1kY/s1600/artigo_regexp_replace_cep_formatado.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg99QQWSqOaSF4n9JAREU0er0S7gNJCWeKaynmttYbVkuXKn0bTYdKXwJd0YYclx3FdzeOAESFnGkvzL4FWkaIzwTTykPg2id5InXQKQPMdEENBW7Rys35hjciEEpWGevvb5qsfe9EJ1kY/s1600/artigo_regexp_replace_cep_formatado.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;3º Exemplo&lt;/span&gt;&lt;/b&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;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
Para facilitar, podemos substituir a expressão &quot;&lt;b&gt;[&lt;/b&gt;&lt;b&gt;[:digit:]&lt;/b&gt;&lt;b&gt;]&lt;/b&gt;&quot;&lt;b&gt;&amp;nbsp;&lt;/b&gt;que&amp;nbsp;indica a utilização de caracteres numéricos de 0 até 9,&lt;b&gt;&amp;nbsp;&lt;/b&gt;pela expressão abreviada&amp;nbsp;&lt;b&gt;&quot;\d&quot;&lt;/b&gt;. O resultado será o mesmo.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;b style=&quot;font-size: x-large;&quot;&gt;Solução&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&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/AVvXsEgE7ccBX2G4DL98mQR0Gi031TvPdYzy7b7i6F7JKCzccjcKCsFU8RSHnwIJRsoIsC3vVVfNS8tF3ad1EmhDo0R_xXtD9UtETSRmhCcCo8HSECseqZ0r9wJf3VJ7cwazLqA3iMEPiNKF7ZE/s1600/postgresql_regexp_replace_cep_ex_3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgE7ccBX2G4DL98mQR0Gi031TvPdYzy7b7i6F7JKCzccjcKCsFU8RSHnwIJRsoIsC3vVVfNS8tF3ad1EmhDo0R_xXtD9UtETSRmhCcCo8HSECseqZ0r9wJf3VJ7cwazLqA3iMEPiNKF7ZE/s1600/postgresql_regexp_replace_cep_ex_3.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
Após a execução da sentença, teremos o seguinte resultado:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&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&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/AVvXsEg99QQWSqOaSF4n9JAREU0er0S7gNJCWeKaynmttYbVkuXKn0bTYdKXwJd0YYclx3FdzeOAESFnGkvzL4FWkaIzwTTykPg2id5InXQKQPMdEENBW7Rys35hjciEEpWGevvb5qsfe9EJ1kY/s1600/artigo_regexp_replace_cep_formatado.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg99QQWSqOaSF4n9JAREU0er0S7gNJCWeKaynmttYbVkuXKn0bTYdKXwJd0YYclx3FdzeOAESFnGkvzL4FWkaIzwTTykPg2id5InXQKQPMdEENBW7Rys35hjciEEpWGevvb5qsfe9EJ1kY/s1600/artigo_regexp_replace_cep_formatado.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;b style=&quot;color: #741b47; font-family: Arial, Helvetica, sans-serif;&quot;&gt;Deixe o seu comentário ou sugestão.&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;b&gt;Gostou?&amp;nbsp; Siga no Google +&amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: small;&quot;&gt;ou Facebook&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;.&lt;/b&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://jquerydicas.blogspot.com/feeds/5179150401035710671/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://jquerydicas.blogspot.com/2015/04/postgresql-formatar-cep-com.html#comment-form' title='6 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/5179150401035710671'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/5179150401035710671'/><link rel='alternate' type='text/html' href='http://jquerydicas.blogspot.com/2015/04/postgresql-formatar-cep-com.html' title='Postgresql - Formatar CEP com REGEXP_REPLACE'/><author><name>Kelly</name><uri>http://www.blogger.com/profile/03449060135636479990</uri><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/AVvXsEiTUzGriOmBfWEijvTKNMefAJVBWl6enPUFOr3bBBX89HkE-_X1IcvYvLgH311duTtbOhIpk4KNQOCv4mwNMdI73Q_RwVH_j6rMXuaB4plPNwi6-6A7q8mDrF-jWh3MvGUfUw99mtWNx8M/s72-c/artigo_regexp_replace_tb_endereco.png" height="72" width="72"/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7010404629734647455.post-6041323861448116219</id><published>2015-02-17T14:05:00.001-02:00</published><updated>2015-02-18T09:52:39.753-02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="dense_rank in mysql"/><category scheme="http://www.blogger.com/atom/ns#" term="dense_rank no mysql"/><category scheme="http://www.blogger.com/atom/ns#" term="equivalente a rownum no mysql"/><category scheme="http://www.blogger.com/atom/ns#" term="ordenar valores por posição"/><category scheme="http://www.blogger.com/atom/ns#" term="posição dos valores sql"/><category scheme="http://www.blogger.com/atom/ns#" term="rankear valores"/><category scheme="http://www.blogger.com/atom/ns#" term="ranquear valores"/><category scheme="http://www.blogger.com/atom/ns#" term="rownum in mysql"/><title type='text'>Mysql - rank de valores (numerar registros de acordo com o valor de uma coluna)</title><content type='html'>&lt;span style=&quot;font-family: inherit;&quot;&gt;Neste artigo, vamos apresentar 7 exemplos de como exibir as posições de acordo com valores de uma coluna, ou explicando de uma forma mais simples, como ranquear os valores de uma coluna.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #660000; font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; color: #660000; font-family: inherit;&quot;&gt;No &lt;/span&gt;&lt;b style=&quot;color: #660000; font-family: inherit;&quot;&gt;1º exemplo&lt;/b&gt;&lt;span style=&quot;background-color: white; color: #660000; font-family: inherit;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;color: #660000; font-family: inherit;&quot;&gt;não&lt;/b&gt;&lt;span style=&quot;background-color: white; color: #660000; font-family: inherit;&quot;&gt; levamos em consideração os &lt;/span&gt;&lt;b style=&quot;color: #660000; font-family: inherit;&quot;&gt;empates&lt;/b&gt;&lt;span style=&quot;background-color: white; color: #660000; font-family: inherit;&quot;&gt;, &lt;/span&gt;&lt;b style=&quot;color: #660000; font-family: inherit;&quot;&gt;a partir&amp;nbsp;2º exemplo &lt;/b&gt;&lt;span style=&quot;background-color: white; color: #660000; font-family: inherit;&quot;&gt;os &lt;/span&gt;&lt;b style=&quot;color: #660000; font-family: inherit;&quot;&gt;empates serão considerados&lt;/b&gt;&lt;span style=&quot;background-color: white; color: #660000; font-family: inherit;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #660000; font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
Caso tenha interesse, faça o &lt;a href=&quot;https://drive.google.com/open?id=0B7sttJEXxZumfjUxUnROYWVMOV9WU2hheDFFaUZkbG4xQnJsU25vLUF3M3hVM2ZGV3VLbU0&amp;amp;authuser=0&quot; target=&quot;_blank&quot;&gt;download&lt;/a&gt; dos exemplos ou veja o script no&amp;nbsp;&lt;a href=&quot;https://github.com/kellysc2013/dicas_sql_jquery/blob/master/artigo_mysql_rank_de_valores/artigo_mysql_rank_de_valores_atualizacao.sql&quot; target=&quot;_blank&quot;&gt;github&lt;/a&gt;.&lt;br /&gt;
Você também pode executar os exemplos através do &lt;a href=&quot;http://sqlfiddle.com/#!9/7815b/1&quot; target=&quot;_blank&quot;&gt;sqlfiddle&lt;/a&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b style=&quot;font-family: inherit;&quot;&gt;1º) Exemplo&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Queremos exibir a classificação dos atletas em uma corrida de acordo com o tempo gasto para completar a prova.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Para exibir a classificação vamos utilizar a tabela &quot;tb_corrida&quot; exibida abaixo:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&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/AVvXsEj6Lrv-_PrEl7xYkjxfGvzFcS4ieL1bk3KsZH9MYhxb9Xv4LbSW-dZysNQGf7EbRs7uFvXvgNdyThWC2kxe9uf8veCtPBySolC7I4jY9T1ShCjNhQ_SYSFjFhR1xtvX9iQASnkiDfhD3Pw/s1600/artigo_mysql_rank_tb_corrida_v1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6Lrv-_PrEl7xYkjxfGvzFcS4ieL1bk3KsZH9MYhxb9Xv4LbSW-dZysNQGf7EbRs7uFvXvgNdyThWC2kxe9uf8veCtPBySolC7I4jY9T1ShCjNhQ_SYSFjFhR1xtvX9iQASnkiDfhD3Pw/s1600/artigo_mysql_rank_tb_corrida_v1.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;SOLUÇÃO:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
Podemos resolver este problema de duas formas:&lt;br /&gt;
&lt;br /&gt;
&lt;b style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;1ª FORMA: &lt;/b&gt;&amp;nbsp;declarar uma variável e utiliza-lá em um select.&amp;nbsp;No nosso exemplo, vamos utilizar a variável @posicao. A variável posição é incrementada 1 unidade a cada registro.&lt;br /&gt;
Os registros foram ordenados de acordo com o tempo gasto através da clausula &quot;&lt;span style=&quot;color: #741b47;&quot;&gt;ORDER BY&lt;/span&gt;&quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #073763;&quot;&gt;SET @posicao:=0&lt;/span&gt;;&lt;/b&gt;&lt;br /&gt;
SELECT&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0b5394;&quot;&gt;@posicao:=@posicao+1&lt;/span&gt; AS posicao,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; inscricao,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; grupo,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; TIME_FORMAT(tempo_gasto, &#39;%H:%i:%s&#39;) AS tempo_gasto&lt;br /&gt;
FROM tb_corrida&lt;br /&gt;
&lt;span style=&quot;color: #741b47;&quot;&gt;ORDER BY&lt;/span&gt; tempo_gasto;&lt;br /&gt;
&lt;br /&gt;
Após a execução da sentença acima, teremos o resultado a seguir:&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/AVvXsEinBhcalxvyBGpOlRx_d5e6wd_phu7Y8ax-glXSpj34fe5WXJqxMPui8DAaSVet2ITZya8ufN6HKP0mB5oY49ldQJe1qpRnuyiTt9yZ_SrTdAfCVD2hpxg5o2uDZ_p0Hp1FMz9z_205CGA/s1600/artigo_mysql_rank_ex_1_forma1_v1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinBhcalxvyBGpOlRx_d5e6wd_phu7Y8ax-glXSpj34fe5WXJqxMPui8DAaSVet2ITZya8ufN6HKP0mB5oY49ldQJe1qpRnuyiTt9yZ_SrTdAfCVD2hpxg5o2uDZ_p0Hp1FMz9z_205CGA/s1600/artigo_mysql_rank_ex_1_forma1_v1.png&quot; height=&quot;224&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;2ª FORMA: &amp;nbsp;&lt;/b&gt;também é possível,&amp;nbsp;usar uma variável dentro de uma subquery sem a necessidade de declara-lá no inicio através da clausula &quot;SET&quot;.&lt;br /&gt;
No nosso caso, criamos uma subquery que recebeu o alias (apelido) de &quot;&lt;span style=&quot;color: #073763;&quot;&gt;classificacao&lt;/span&gt;&quot;. Fizemos um &quot;&lt;span style=&quot;color: #274e13;&quot;&gt;CROSS JOIN&lt;/span&gt;&quot; da subquery &quot;&lt;span style=&quot;color: #073763;&quot;&gt;classificacao&lt;/span&gt;&quot; com a tabela &amp;nbsp;&quot;&lt;span style=&quot;color: #674ea7;&quot;&gt;tb_corrida&lt;/span&gt;&quot;.&lt;br /&gt;
Neste exemplo, vamos utilizar a variável&amp;nbsp;&lt;span style=&quot;color: #073763;&quot;&gt;@posicao&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
SELECT&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #073763;&quot;&gt;@posicao := @posicao + 1 AS posicao&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; tb_corrida.inscricao,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; tb_corrida.grupo,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; TIME_FORMAT(tb_corrida.tempo_gasto, &#39;%H:%i:%s&#39;) AS tempo_gasto&lt;br /&gt;
FROM&lt;br /&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;(SELECT @posicao := 0) classificacao&lt;/span&gt; &lt;span style=&quot;color: #274e13;&quot;&gt;CROSS JOIN&lt;/span&gt; &lt;span style=&quot;color: #674ea7;&quot;&gt;tb_corrida&lt;/span&gt;&lt;br /&gt;
ORDER BY tempo_gasto;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b style=&quot;font-size: x-large;&quot;&gt;2º) Exemplo&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Queremos exibir a classificação dos atletas em uma corrida de acordo com o tempo gasto para completar a prova,&lt;b&gt; levando em consideração o empate&lt;/b&gt;. Vamos utilizar a mesma tabela do 1º exemplo &quot;tb_corrida&quot;.&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/AVvXsEj6Lrv-_PrEl7xYkjxfGvzFcS4ieL1bk3KsZH9MYhxb9Xv4LbSW-dZysNQGf7EbRs7uFvXvgNdyThWC2kxe9uf8veCtPBySolC7I4jY9T1ShCjNhQ_SYSFjFhR1xtvX9iQASnkiDfhD3Pw/s1600/artigo_mysql_rank_tb_corrida_v1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6Lrv-_PrEl7xYkjxfGvzFcS4ieL1bk3KsZH9MYhxb9Xv4LbSW-dZysNQGf7EbRs7uFvXvgNdyThWC2kxe9uf8veCtPBySolC7I4jY9T1ShCjNhQ_SYSFjFhR1xtvX9iQASnkiDfhD3Pw/s1600/artigo_mysql_rank_tb_corrida_v1.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;SOLUÇÃO:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
Podemos resolver este problema de &lt;b&gt;duas formas&lt;/b&gt;:&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;1ª FORMA:&amp;nbsp;&lt;/b&gt;declarar duas variáveis e utilizá-las em um select.&amp;nbsp;No nosso exemplo, vamos utilizar a variável&amp;nbsp;&lt;span style=&quot;color: #073763;&quot;&gt;@posicao &lt;/span&gt;e a variável&lt;span style=&quot;color: #073763;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #674ea7;&quot;&gt;@tempo_gasto&lt;/span&gt;.&lt;br /&gt;
Caso o valor do tempo for igual ao tempo anterior manteremos o valor da variável&amp;nbsp;&lt;span style=&quot;color: #073763;&quot;&gt;@posicao&lt;/span&gt;, caso contrário o valor&amp;nbsp;da variável&amp;nbsp;&lt;span style=&quot;color: #073763;&quot;&gt;@posicao&lt;/span&gt;&amp;nbsp;será&amp;nbsp;&amp;nbsp;incrementado em uma 1 unidade.&lt;br /&gt;
&lt;b style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&lt;/b&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
SET&amp;nbsp;&lt;span style=&quot;color: #073763;&quot;&gt;@posicao&lt;/span&gt;:=0;&lt;br /&gt;
SET &lt;span style=&quot;color: #674ea7;&quot;&gt;@tempo_gasto&lt;/span&gt;:=NULL;&lt;br /&gt;
SELECT&lt;br /&gt;
&lt;span style=&quot;color: #274e13;&quot;&gt;@posicao:=&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #274e13;&quot;&gt;&amp;nbsp; &amp;nbsp; CASE&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #274e13;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; WHEN CAST&lt;/span&gt;(&lt;span style=&quot;color: #274e13;&quot;&gt;@tempo_gasto AS TIME)=tempo_gasto THEN @posicao&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #274e13;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ELSE @posicao + 1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #274e13;&quot;&gt;&amp;nbsp; &amp;nbsp; END&lt;/span&gt;&lt;br /&gt;
AS posicao,&lt;br /&gt;
inscricao,&lt;br /&gt;
grupo,&lt;br /&gt;
@tempo_gasto:= &amp;nbsp;CAST(tempo_gasto&lt;span style=&quot;color: #274e13;&quot;&gt;&amp;nbsp;&lt;/span&gt;AS TIME)&amp;nbsp;as tempo_gasto&lt;br /&gt;
FROM tb_corrida&lt;br /&gt;
ORDER BY tempo_gasto;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Após a execução da sentença acima,&amp;nbsp; teremos o resultado da imagem seguir:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&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/AVvXsEjcOQMhm8kqSxcN4Euq7fYppRPMs3MJkKhbLdAIguAoflCfZVhhVSCN14LAWcnRbfAJ3WRM4HEDd-BqKMAuZn3boOBq2rCKeCNyAUEYxz6KXb_7RmQYnS6b25PeN-dOQ8HLHCPNiu_Fh7w/s1600/artigo_mysql_rank_ex_2_forma1_v1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcOQMhm8kqSxcN4Euq7fYppRPMs3MJkKhbLdAIguAoflCfZVhhVSCN14LAWcnRbfAJ3WRM4HEDd-BqKMAuZn3boOBq2rCKeCNyAUEYxz6KXb_7RmQYnS6b25PeN-dOQ8HLHCPNiu_Fh7w/s1600/artigo_mysql_rank_ex_2_forma1_v1.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;b style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;2ª FORMA:&amp;nbsp;&lt;/b&gt;também é possível, usar as variáveis dentro de uma subquery, sem a necessidade declará-las através da clausulá &quot;SET&quot;&lt;br /&gt;
Devemos fazer um &quot;&lt;span style=&quot;color: #274e13; font-family: Arial, Helvetica, sans-serif;&quot;&gt;CROSS JOIN&lt;/span&gt;&quot; da subquery &quot;&lt;span style=&quot;color: #073763; font-family: Arial, Helvetica, sans-serif;&quot;&gt;classificacao&lt;/span&gt;&quot;&amp;nbsp;com a tabela tabela &quot;&lt;span style=&quot;color: #674ea7; font-family: Arial, Helvetica, sans-serif;&quot;&gt;tb_corrida&lt;/span&gt;&quot;.&lt;br /&gt;
&lt;b style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/b&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;SELECT&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;@posicao:=&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; CASE&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; WHEN CAST(@tempo_gasto AS TIME) =tempo_gasto THEN @posicao&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ELSE @posicao + 1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; END&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;AS posicao,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;inscricao,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;grupo,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;@tempo_gasto:= tempo_gasto as tempo_gasto&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;FROM&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #073763;&quot;&gt; (SELECT @posicao:=0, @tempo_gasto:=CAST(NULL AS time)) classificacao&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #274e13; font-family: Arial, Helvetica, sans-serif;&quot;&gt;CROSS JOIN&lt;/span&gt;&lt;span style=&quot;color: #073763; font-family: Arial, Helvetica, sans-serif;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #674ea7; font-family: Arial, Helvetica, sans-serif;&quot;&gt;tb_corrida&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;ORDER BY tempo_gasto;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b style=&quot;font-size: x-large;&quot;&gt;3º) Exemplo&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Exibir a classificação dos atletas por grupo (&quot;A&quot;, &quot;B&quot;, &quot;C&quot;).&lt;br /&gt;
&lt;br /&gt;
&lt;b style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;SOLUÇÃO&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Podemos resolver este problema de&amp;nbsp;&lt;b&gt;duas formas&lt;/b&gt;:&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;b style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;1ª FORMA&lt;/b&gt;&lt;br /&gt;
&lt;b style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/b&gt;
Observe que os registros foram ordenados por grupo e tempo gasto.&lt;br /&gt;
Cada vez que se inicia um novo grupo é atribuído o valor 1 a variável&amp;nbsp;@posicao, para que a contagem seja reiniciada.&lt;br /&gt;
Veja o trecho destacado em azul.&lt;br /&gt;
&lt;br /&gt;
SET @posicao:=0;&lt;br /&gt;
SET @grupo:=&#39;&#39;;&lt;br /&gt;
SET @tempo_gasto:=cast(&#39;00:00:00&#39; AS time);&lt;br /&gt;
SELECT&lt;br /&gt;
@posicao:=&lt;br /&gt;
&amp;nbsp; &amp;nbsp; CASE&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #073763;&quot;&gt;WHEN @grupo&amp;lt;&amp;gt;grupo THEN 1&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; WHEN CAST(@tempo_gasto AS TIME) = tempo_gasto THEN @posicao&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ELSE @posicao + 1&lt;br /&gt;
&amp;nbsp; &amp;nbsp; END&lt;br /&gt;
AS posicao,&lt;br /&gt;
inscricao,&lt;br /&gt;
@grupo := grupo as grupo,&lt;br /&gt;
@tempo_gasto:= CAST(tempo_gasto&amp;nbsp;AS TIME)&amp;nbsp;&amp;nbsp;as tempo_gasto&lt;br /&gt;
FROM tb_corrida&lt;br /&gt;
ORDER BY grupo, tempo_gasto;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Após a execução da sentença acima, teremos o resultado da imagem seguir:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&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/AVvXsEjpTHpzPZIIDucodPGxidlpeWF25dTxZWDm_Ax51a9uc9YHXrf7LzRCCkGBlkvovcCOdZQqibvybUNwHVMWdM0VLzhguv5JJEfmjJDj9xfbSOKP1FsWl7J1eoigBGTjvGSGdqv4rxQ4xzE/s1600/artigo_mysql_rank_ex_3_forma1_v1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpTHpzPZIIDucodPGxidlpeWF25dTxZWDm_Ax51a9uc9YHXrf7LzRCCkGBlkvovcCOdZQqibvybUNwHVMWdM0VLzhguv5JJEfmjJDj9xfbSOKP1FsWl7J1eoigBGTjvGSGdqv4rxQ4xzE/s1600/artigo_mysql_rank_ex_3_forma1_v1.png&quot; height=&quot;226&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;b style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;2ª FORMA: &lt;/b&gt;também podemos resolver o terceiro exemplo utilizando subquery.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
SELECT&lt;br /&gt;
@posicao:=&lt;br /&gt;
&amp;nbsp; &amp;nbsp; CASE&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #073763;&quot;&gt;WHEN @grupo&amp;lt;&amp;gt;grupo THEN 1&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; WHEN &amp;nbsp;CAST(@tempo_gasto AS TIME) = tempo_gasto &amp;nbsp;THEN @posicao&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ELSE @posicao + 1&lt;br /&gt;
&amp;nbsp; &amp;nbsp; END&lt;br /&gt;
AS posicao,&lt;br /&gt;
inscricao,&lt;br /&gt;
@grupo := grupo AS grupo,&lt;br /&gt;
@tempo_gasto:= &amp;nbsp;CAST(tempo_gasto AS TIME) as tempo_gasto&lt;br /&gt;
FROM&lt;br /&gt;
(SELECT @posicao := 0, @tempo_gasto := CAST(NULL AS time), @grupo:=&#39;&#39;) classificacao&lt;br /&gt;
CROSS JOIN tb_corrida&lt;br /&gt;
ORDER BY grupo, tempo_gasto;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b style=&quot;font-size: x-large;&quot;&gt;4º) Exemplo&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Exibir a classificação dos atletas até a 4ª posição.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;SOLUÇÃO:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;Para resolver este problema os registros foram ordenados por tempo gasto.&lt;br /&gt;
Foi criada uma subquery, a qual chamamos de &quot;&lt;b style=&quot;color: #274e13;&quot;&gt;tb_colocacoes&lt;/b&gt;&quot;.&lt;br /&gt;
A seguir, foram filtrados os registros com posição menor ou igual a 4.&lt;br /&gt;
&lt;br /&gt;
SET @posicao:= 0;&lt;br /&gt;
SET @tempo_gasto:= NULL;&lt;br /&gt;
SELECT * FROM&lt;br /&gt;
&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;b&gt;(&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; SELECT&lt;br /&gt;
&amp;nbsp; &amp;nbsp; @posicao:=&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CASE&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; WHEN CAST(@tempo_gasto AS time) = tempo_gasto THEN @posicao&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ELSE @posicao + 1&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; END&lt;br /&gt;
&amp;nbsp; &amp;nbsp; AS posicao,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; inscricao,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; grupo,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; @tempo_gasto:= CAST(tempo_gasto AS TIME) as tempo_gasto&lt;br /&gt;
&amp;nbsp; &amp;nbsp; FROM tb_corrida&lt;br /&gt;
&amp;nbsp; &amp;nbsp; ORDER BY tempo_gasto&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;)&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;b&gt; tb_colocacoes&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #073763;&quot;&gt;&amp;nbsp;WHERE posicao &amp;lt;= 4&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Após a execução da sentença acima,&amp;nbsp; teremos o seguinte resultado:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&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/AVvXsEjEMvkEyWMFlvdH2ZYfnJvl_CoijAvXjalBVZsj7HbQxWuqQG-4wrjnficPHwBtCROMKEmbBmw0PQogApwjn2yJ8TDmGznPsaD0V25f75mEhSLirw5nxufKH0L2YAFA9h7g9aANDK2aFDE/s1600/artigo_mysql_rank_ex_4_v1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEMvkEyWMFlvdH2ZYfnJvl_CoijAvXjalBVZsj7HbQxWuqQG-4wrjnficPHwBtCROMKEmbBmw0PQogApwjn2yJ8TDmGznPsaD0V25f75mEhSLirw5nxufKH0L2YAFA9h7g9aANDK2aFDE/s1600/artigo_mysql_rank_ex_4_v1.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b style=&quot;font-size: x-large;&quot;&gt;5º) Exemplo&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Os atletas que alcançaram até a 2ª&amp;nbsp;&lt;b&gt;colocação por grupo&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;SOLUÇÃO:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;span style=&quot;color: #073763;&quot;&gt;Para resolver este problema os registros foram ordenados por grupo e tempo gasto.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;Foi utilizada&amp;nbsp;uma subquery, a qual chamamos de &quot;&lt;b&gt;tb_colocacoes&lt;/b&gt;&quot;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;A seguir, foram filtrados os registros com posição menor ou igual a 2.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
SET @posicao :=0;&lt;br /&gt;
SET @grupo :=&#39;&#39;;&lt;br /&gt;
SET @tempo_gasto := NULL;&lt;br /&gt;
SELECT * FROM&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;(&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; SELECT&lt;br /&gt;
&amp;nbsp; &amp;nbsp; @posicao:=&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CASE&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; WHEN @grupo&amp;lt;&amp;gt;grupo THEN 1&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; WHEN CAST(@tempo_gasto AS TIME) = tempo_gasto THEN @posicao&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ELSE @posicao + 1&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; END&lt;br /&gt;
&amp;nbsp; &amp;nbsp; AS posicao,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; inscricao,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; @grupo := grupo as grupo,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; @tempo_gasto:= &amp;nbsp;&amp;nbsp;CAST(tempo_gasto AS TIME) AS tempo_gasto&lt;br /&gt;
&amp;nbsp; &amp;nbsp; FROM tb_corrida&lt;br /&gt;
&amp;nbsp; &amp;nbsp; ORDER BY grupo, tempo_gasto&lt;br /&gt;
&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;b&gt;) tb_colocacoes&amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;WHERE&lt;span style=&quot;color: #073763;&quot;&gt; posicao &amp;lt;= 2&lt;/span&gt;;&lt;br /&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
Após a execução da sentença acima, teremos o resultado da imagem seguir:&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/AVvXsEhGXQh9WvL7SSOAFI7e6Xo0bKmSDlgQQ62WMfJw1YSikQj8JOS9MirXAyfK8ueXWbfvWTwZvH19GmR2j_-QOjUKja9vM9SBuDVk9QK8wMM78ndAVu2I7Unuuh4rAq4KtPpobZd-eAA9Nz4/s1600/artigo_mysql_rank_ex_5_v1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGXQh9WvL7SSOAFI7e6Xo0bKmSDlgQQ62WMfJw1YSikQj8JOS9MirXAyfK8ueXWbfvWTwZvH19GmR2j_-QOjUKja9vM9SBuDVk9QK8wMM78ndAVu2I7Unuuh4rAq4KtPpobZd-eAA9Nz4/s1600/artigo_mysql_rank_ex_5_v1.png&quot; height=&quot;164&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b style=&quot;font-size: x-large;&quot;&gt;6º) Exemplo&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Vamos listar o ranking de vendedores de uma loja, de acordo com o total de mercadorias vendidas. Neste exemplo, vamos utilizar uma nova tabela chamada &quot;tb_vendas&quot;. Veja a imagem da tabela &quot;tb_vendas&quot; a seguir:&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/AVvXsEjLOpAk771iLESux7T2NJ2BgvBjuVLqMQe_IM6vGwvB_d3qRLdqZj2Qdm58yKTTOw-vLZ9i8j5BStQm4NaXN4rYS4j5mLDmaSw_zqJl7GMnz80hklqUAE_LdqyOsCbU0VPn8PrOJaFSAtQ/s1600/artigo_mysql_tb_vendas.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLOpAk771iLESux7T2NJ2BgvBjuVLqMQe_IM6vGwvB_d3qRLdqZj2Qdm58yKTTOw-vLZ9i8j5BStQm4NaXN4rYS4j5mLDmaSw_zqJl7GMnz80hklqUAE_LdqyOsCbU0VPn8PrOJaFSAtQ/s1600/artigo_mysql_tb_vendas.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;SOLUÇÃO&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;Veja que antes de criar o ranking com as posições, tivemos que somar o total para cada vendedor, esta soma foi armazenada em uma subquery que recebeu o alias (apelido) de &quot;&lt;/span&gt;&lt;b style=&quot;color: #073763;&quot;&gt;total vendas&lt;/b&gt;&lt;span style=&quot;color: #073763;&quot;&gt;&quot;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;Perceba que neste exemplo, estamos ordenando os totais por vendedor de forma&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #073763;&quot;&gt;decrescente&amp;nbsp;(&lt;/span&gt;&lt;span style=&quot;color: #073763;&quot;&gt;do maior para o menor&lt;/span&gt;&lt;span style=&quot;color: #073763;&quot;&gt;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&amp;nbsp;&quot;&lt;/span&gt;&lt;span style=&quot;color: #073763;&quot;&gt;ORDER BY total_vendedor DESC&lt;/span&gt;&lt;span style=&quot;color: #073763;&quot;&gt;&quot;, pois os vendedores que venderão mais serão os primeiros. &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
SET @posicao:=0;&lt;br /&gt;
SET @total_vendedor:= 0.0;&lt;br /&gt;
SELECT&lt;br /&gt;
@posicao:=&lt;br /&gt;
&amp;nbsp; &amp;nbsp; CASE&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; WHEN @total_vendedor=total_vendedor THEN @posicao&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ELSE @posicao + 1&lt;br /&gt;
&amp;nbsp; &amp;nbsp; END&lt;br /&gt;
AS posicao,&lt;br /&gt;
vendedor_id,&lt;br /&gt;
@total_vendedor:= total_vendedor as total_vendedor&lt;br /&gt;
FROM&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #073763;&quot;&gt;(&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; SELECT vendedor_id, SUM(valor) AS total_vendedor FROM&lt;br /&gt;
&amp;nbsp; &amp;nbsp; tb_vendas GROUP BY vendedor_id&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #073763;&quot;&gt;) &lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;total_vendas&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
ORDER BY total_vendedor DESC;&lt;br /&gt;
&lt;br /&gt;
Após a execução da sentença acima, teremos o resultado da imagem seguir:&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/AVvXsEizeyt2TJnDRYT9i0YbOKFwpLo5jowhttVLcYPP1AysIs6lEyZN9lhg1lxtjcZqjk8Fsvv1p1f4d4zFennjHo0kjwhIY8zz17Qfr-KbDjnJzINAVEljtRIMQlU803asHPsmXXAp7R2Cxg4/s1600/artigo_mysql_rank_ex_6_v1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizeyt2TJnDRYT9i0YbOKFwpLo5jowhttVLcYPP1AysIs6lEyZN9lhg1lxtjcZqjk8Fsvv1p1f4d4zFennjHo0kjwhIY8zz17Qfr-KbDjnJzINAVEljtRIMQlU803asHPsmXXAp7R2Cxg4/s1600/artigo_mysql_rank_ex_6_v1.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b style=&quot;font-size: x-large;&quot;&gt;7º) Exemplo&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;Listar os vendedores que foram classificados até 3º lugar. Neste exemplo, também vamos utilizar a tabela &quot;tb_vendas&quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;SOLUÇÃO&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;Armazenamos todas as posições na subquery &quot;&lt;/span&gt;&lt;span style=&quot;color: #073763;&quot;&gt;vendas_gerais&lt;/span&gt;&lt;span style=&quot;color: #073763;&quot;&gt;&quot; e filtramos os vendedores com a posição menor ou igual a 3.&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
SET @posicao:=0;&lt;br /&gt;
SET @total_vendedor:= 0.0;&lt;br /&gt;
SELECT * FROM&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #073763;&quot;&gt;(&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; SELECT&lt;br /&gt;
&amp;nbsp; &amp;nbsp; @posicao:=&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CASE&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; WHEN @total_vendedor=total_vendedor THEN @posicao&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ELSE @posicao + 1&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; END&lt;br /&gt;
&amp;nbsp; &amp;nbsp; AS posicao,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; vendedor_id,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; @total_vendedor:= total_vendedor as total_vendedor&lt;br /&gt;
&amp;nbsp; &amp;nbsp; FROM&lt;br /&gt;
&amp;nbsp; &amp;nbsp; (&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SELECT vendedor_id, SUM(valor) AS total_vendedor FROM&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tb_vendas GROUP BY vendedor_id&lt;br /&gt;
&amp;nbsp; &amp;nbsp; ) total_vendas&lt;br /&gt;
&amp;nbsp; &amp;nbsp; ORDER BY total_vendedor DESC&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #073763;&quot;&gt;)&lt;/span&gt;&lt;/b&gt; &lt;span style=&quot;color: #073763;&quot;&gt;vendas_gerais&lt;/span&gt;&lt;span style=&quot;color: #674ea7;&quot;&gt; WHERE posicao &amp;lt;= 3&lt;/span&gt;;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Após a execução da sentença acima, teremos o resultado da imagem seguir:&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/AVvXsEjHmdyId0fLzKdrgDQdBrxSFP_e3zr9UVUBZCXq_kOPRsmpx9WV4mBGn3lBN88WzdCqN6x0BbImqCAegreD2Er6JkRFUUoARgaAyvAMieaWxEPaCMfQl8ccJTqG66ytJKlIa1tA97_WwRQ/s1600/artigo_mysql_rank_ex_7_v1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHmdyId0fLzKdrgDQdBrxSFP_e3zr9UVUBZCXq_kOPRsmpx9WV4mBGn3lBN88WzdCqN6x0BbImqCAegreD2Er6JkRFUUoARgaAyvAMieaWxEPaCMfQl8ccJTqG66ytJKlIa1tA97_WwRQ/s1600/artigo_mysql_rank_ex_7_v1.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;b style=&quot;color: #741b47; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/b&gt;

&lt;b style=&quot;color: #741b47; font-family: Arial, Helvetica, sans-serif;&quot;&gt;Deixe o seu comentário ou sugestão.&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;b&gt;Gostou?&amp;nbsp; Siga no Google +&amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: small;&quot;&gt;ou Facebook&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;.&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jquerydicas.blogspot.com/feeds/6041323861448116219/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://jquerydicas.blogspot.com/2015/02/mysql-rank-de-valores-numerar-registros.html#comment-form' title='19 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/6041323861448116219'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/6041323861448116219'/><link rel='alternate' type='text/html' href='http://jquerydicas.blogspot.com/2015/02/mysql-rank-de-valores-numerar-registros.html' title='Mysql - rank de valores (numerar registros de acordo com o valor de uma coluna)'/><author><name>Kelly</name><uri>http://www.blogger.com/profile/03449060135636479990</uri><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/AVvXsEj6Lrv-_PrEl7xYkjxfGvzFcS4ieL1bk3KsZH9MYhxb9Xv4LbSW-dZysNQGf7EbRs7uFvXvgNdyThWC2kxe9uf8veCtPBySolC7I4jY9T1ShCjNhQ_SYSFjFhR1xtvX9iQASnkiDfhD3Pw/s72-c/artigo_mysql_rank_tb_corrida_v1.png" height="72" width="72"/><thr:total>19</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7010404629734647455.post-8713675191469075038</id><published>2015-02-07T12:06:00.000-02:00</published><updated>2015-02-07T18:12:26.634-02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="funções de agrupamento"/><category scheme="http://www.blogger.com/atom/ns#" term="oracle"/><category scheme="http://www.blogger.com/atom/ns#" term="rollup"/><title type='text'>ORACLE - Calcular total /subtotal com ROLLUP</title><content type='html'>Neste artigo, vamos mostrar 3 exemplos de como&amp;nbsp;utilizar a função &quot;SUM&quot; acompanhada do comando &quot;ROLLUP&quot; para&amp;nbsp;calcular o subtotal / total em uma consulta.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Caso tenha interesse, faça o&amp;nbsp;&lt;a href=&quot;https://drive.google.com/open?id=0B7sttJEXxZumfi0zYWVkMlMzN0lLb3pGWjYyYjhfSlJBaTBBcU0zNVhkOW85aXpDU29mcE0&amp;amp;authuser=0&quot; target=&quot;_blank&quot;&gt;download&lt;/a&gt;&amp;nbsp;ou&amp;nbsp;veja os scripts deste artigo no&amp;nbsp;&lt;a href=&quot;https://github.com/kellysc2013/dicas_sql_jquery/blob/master/artigo_oracle_calcular_total_subtotal_com_rollup/artigo_oracle_total_subtotal_com_rollup.sql&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;github&lt;/a&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Você também pode executar os scripts e visualizar as tabelas no &lt;a href=&quot;http://sqlfiddle.com/#!4/cd35c/1&quot; target=&quot;_blank&quot;&gt;sqlfiddle&lt;/a&gt;. O script foi testado no Oracle 11g R2.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;1º &amp;nbsp;Exemplo&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Vamos calcular as despesas com fornecedor para cada segmento de uma empresa.&lt;br /&gt;
Iremos exibir o subtotal por segmento: &quot;Papelaria e informática&quot;, &quot;Marcenaria&quot;, &quot;Serralheria&quot; e &quot;Limpeza e higiêne&quot;.&lt;br /&gt;
Também vamos exibir no final da consulta o total geral para todos os segmentos.&lt;br /&gt;
Neste exemplo, utilizaremos a tabela &quot;tb_fornecedor&quot;. Veja a imagem da tabela a seguir:&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/AVvXsEhePH7d1N6MDzXvAPZhGIf93X7Q3QEByAZQv_XUQjANcKYEaVzm2bTR3saJYv9bhckww6-TInqJ_uxwYUggfeVKoa5FV2YEIuhr8xW0X6Vf7CTpbq-DqliAPxO4YHQzDGsj2vhA4tVGQak/s1600/artigo_oracle_rollup_img_tab_fornecedor.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhePH7d1N6MDzXvAPZhGIf93X7Q3QEByAZQv_XUQjANcKYEaVzm2bTR3saJYv9bhckww6-TInqJ_uxwYUggfeVKoa5FV2YEIuhr8xW0X6Vf7CTpbq-DqliAPxO4YHQzDGsj2vhA4tVGQak/s1600/artigo_oracle_rollup_img_tab_fornecedor.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Solução&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
Vamos utilizar a função &quot;SUM&quot; acompanhada de &quot;GROUP BY&quot; para fazer a quebra por segmento. Além disso vamos utilizar o &quot;ROLLUP&quot; para exibir o subtotal embaixo de cada quebra e o total geral no último registro.&lt;br /&gt;
&lt;br /&gt;
Veja a sentença abaixo:&lt;br /&gt;
&lt;br /&gt;
SELECT&lt;br /&gt;
&amp;nbsp; &amp;nbsp; segmento,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; produto,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; SUM(valor)&lt;br /&gt;
FROM tb_fornecedor&lt;br /&gt;
GROUP BY &lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;ROLLUP(segmento, produto)&lt;/b&gt;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
Após a execução da sentença teremos o resultado exibido a seguir:&lt;br /&gt;
&lt;br /&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/AVvXsEglPexCWPBlKV0Fo8mzb95juldQOJ9L8BsoEPMx1Ht2Fwp-9EBpaEzKBx113VaxrNsrrFjAhNr7ocZf5rK_Q3VW4y7WJUDAxglt8umY4vrM_1EdNTJbP_qxQ7-sjODn59c56wt17sV4shw/s1600/artigo_oracle_rollup_img_1_v2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglPexCWPBlKV0Fo8mzb95juldQOJ9L8BsoEPMx1Ht2Fwp-9EBpaEzKBx113VaxrNsrrFjAhNr7ocZf5rK_Q3VW4y7WJUDAxglt8umY4vrM_1EdNTJbP_qxQ7-sjODn59c56wt17sV4shw/s1600/artigo_oracle_rollup_img_1_v2.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;2º &amp;nbsp;Exemplo&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
Para facilitarmos a interpretação do resultado da consulta vamos alterar o conteúdo da primeira coluna:
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Nos registros que exibirem o subtotal, a primeira coluna será acompanhada da palavra &quot;Subtotal&quot; e do nome do segmento;&lt;/li&gt;
&lt;li&gt;O ultimo registro da primeira coluna se chamará &quot;Total Geral&quot;;&lt;/li&gt;
&lt;li&gt;Nos outros registros o nome do segmento será mantido;&lt;/li&gt;
&lt;/ul&gt;
&lt;b&gt;Solução&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
Veja a sentença abaixo:&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
SELECT&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #0c343d;&quot;&gt;CASE&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #073763;&quot;&gt;WHEN (segmento IS NULL AND produto IS NULL)&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #073763;&quot;&gt;&amp;nbsp; THEN &#39;&lt;/span&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;Total Geral&#39;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #073763;&quot;&gt;WHEN (segmento IS NOT NULL AND produto IS NULL)&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #073763;&quot;&gt;&amp;nbsp; THEN &lt;/span&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;&amp;nbsp;&#39;Subtotal&#39; || &#39; - &#39; || segmento &amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #073763;&quot;&gt;ELSE segmento&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;END AS segmento&lt;/b&gt;,&lt;/span&gt;&lt;br /&gt;
produto,&lt;br /&gt;
SUM(valor)&lt;br /&gt;
FROM tb_fornecedor GROUP BY ROLLUP (segmento, produto);&lt;br /&gt;
&lt;br /&gt;
Após a execução da sentença teremos o resultado exibido a seguir:&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/AVvXsEjgKX17y1qD5AytfZgfLyFV5Ui5p-vvsK5udkkrKW0r1rgUgb-YKnK0ijMEx2AfRIiwyBJIOB6C6DhjFekljMVYdLZgDMqLKcHbchiIIA9PklSrhbwGiYuE2eUhqtmf7Y76NEluaCO-u0E/s1600/artigo_oracle_rollup_img_2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgKX17y1qD5AytfZgfLyFV5Ui5p-vvsK5udkkrKW0r1rgUgb-YKnK0ijMEx2AfRIiwyBJIOB6C6DhjFekljMVYdLZgDMqLKcHbchiIIA9PklSrhbwGiYuE2eUhqtmf7Y76NEluaCO-u0E/s1600/artigo_oracle_rollup_img_2.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&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;/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;
Foi utilizado o comando &quot;CASE WHEN&quot; na primeira coluna para verificar:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;se o segmento e o produto eram nulos, &amp;nbsp;caso fossem, houve a substituição por &quot;Total Geral&quot;;&lt;/li&gt;
&lt;li&gt;se o&amp;nbsp;segmento &lt;b&gt;não&lt;/b&gt; era nulo e o produto era nulo, caso fossem,&amp;nbsp;houve a substituição&amp;nbsp;por &quot;Subtotal&quot; concatenado com o&amp;nbsp;nome do segmento;&lt;/li&gt;
&lt;li&gt;se nenhuma condição acima fosse verdadeira, mantivemos o conteúdo da coluna segmento;&lt;/li&gt;
&lt;/ul&gt;
&lt;b&gt;&lt;span style=&quot;color: #4c1130;&quot;&gt;Observação:&lt;/span&gt;&lt;/b&gt; utilizamos o operador de concatenação &quot;&lt;b&gt;&lt;span style=&quot;color: #674ea7;&quot;&gt;||&lt;/span&gt;&lt;/b&gt;&quot; para unir a palavra &quot;Subtotal&quot; ao conteúdo da coluna segmento;&lt;br /&gt;
&lt;ul&gt;
&lt;/ul&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;Também podemos indicar o total geral na primeira coluna e os subtotais na segunda coluna. &amp;nbsp;Veja a sentença abaixo:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
SELECT&lt;br /&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;CASE&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;WHEN (segmento IS NULL AND produto IS NULL)&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;&amp;nbsp; THEN &#39;Total Geral&#39;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;ELSE segmento&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;END AS segmento&lt;/b&gt;&lt;/span&gt;,&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #674ea7;&quot;&gt;CASE&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #674ea7;&quot;&gt;WHEN (segmento IS NOT NULL AND produto IS NULL)&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #674ea7;&quot;&gt;&amp;nbsp; THEN &#39;Subtotal&#39; || &#39; - &#39; || segmento&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #674ea7;&quot;&gt;ELSE produto&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #674ea7;&quot;&gt;END AS produto&lt;/span&gt;&lt;/b&gt;,&lt;br /&gt;
SUM(valor) AS valor&lt;br /&gt;
FROM tb_fornecedor&lt;br /&gt;
GROUP BY ROLLUP (segmento, produto);&lt;br /&gt;
&lt;br /&gt;
Após a execução da sentença teremos o resultado exibido a seguir:&lt;span style=&quot;background-color: white;&quot;&gt;&lt;/span&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/AVvXsEi8c8nIfG3jrBTDeebMPBInPZnln_QyFsEIrD3KQz2sgs4BoZLeN1EXW86t6OV2Q36rv9cQG-TItXzqnDrSneQ95OWht1bMIexlfMg9c1x5HQa_oI_Q5BC35Sw55hNfIyuXBx1VaKDFCvY/s1600/artigo_oracle_rollup_img_3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8c8nIfG3jrBTDeebMPBInPZnln_QyFsEIrD3KQz2sgs4BoZLeN1EXW86t6OV2Q36rv9cQG-TItXzqnDrSneQ95OWht1bMIexlfMg9c1x5HQa_oI_Q5BC35Sw55hNfIyuXBx1VaKDFCvY/s1600/artigo_oracle_rollup_img_3.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;3º &amp;nbsp;Exemplo&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;Neste exemplo, vamos mostrar como ordenar as colunas &quot;segmento&quot; e &quot;produto&quot;, mantendo o &quot;Total Geral&quot; no último registro e o subtotal no final de cada segmento.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Solução&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Vamos utilizar &quot;ORDER BY&quot; em uma subquery (subconsulta).&lt;br /&gt;
&lt;br /&gt;
Veja a sentença abaixo:&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
SELECT&lt;br /&gt;
COALESCE(segmento, &#39;TOTAL GERAL&#39;) &amp;nbsp;AS segmento, &lt;br /&gt;
CASE&lt;br /&gt;
&amp;nbsp;WHEN ((segmento IS NOT NULL) AND (produto IS NULL))&lt;br /&gt;
&amp;nbsp; THEN CONCAT(&#39;Subtotal - &#39;, segmento)&lt;br /&gt;
&amp;nbsp; WHEN (segmento IS NOT NULL AND produto IS NOT NULL)&lt;br /&gt;
&amp;nbsp; THEN produto&lt;br /&gt;
END AS produto,&lt;br /&gt;
valor FROM&lt;br /&gt;
&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;b&gt;(&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp;&lt;span style=&quot;color: #073763;&quot;&gt;SELECT&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;&amp;nbsp;segmento,&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;&amp;nbsp;CASE&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;&amp;nbsp; WHEN(segmento IS NOT NULL) THEN 0&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;&amp;nbsp; ELSE 1&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;&amp;nbsp;END AS segmento_ordem,&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;&amp;nbsp;produto,&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;&amp;nbsp;CASE&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;&amp;nbsp; WHEN(produto IS NOT NULL) THEN 0&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;&amp;nbsp;ELSE 1&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;&amp;nbsp;END &amp;nbsp;AS produto_ordem,&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;&amp;nbsp;SUM(valor) AS valor&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;&amp;nbsp;FROM tb_fornecedor&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&lt;b&gt;&amp;nbsp;GROUP BY ROLLUP(segmento, produto)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;)&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;b style=&quot;color: #4c1130;&quot;&gt;TOTAL&lt;/b&gt;&lt;br /&gt;
ORDER BY&lt;br /&gt;
segmento,&lt;br /&gt;
segmento_ordem,&lt;br /&gt;
produto_ordem,&lt;br /&gt;
produto;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
A&amp;nbsp;subquery&amp;nbsp;que criamos está destacada na cor azul e está posicionada entre parenteses, esta&amp;nbsp;subquery&amp;nbsp;recebeu o&amp;nbsp;alias&amp;nbsp;(apelido) de TOTAL.&lt;br /&gt;
&lt;br /&gt;
Observação: perceba que utilizamos duas vezes o &quot;CASE WHEN&quot; na subquery:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;o primeiro para que o &quot;TOTAL GERAL&quot; fosse exibido no último registo da coluna &quot;segmento&quot; independente da ordem alfabética;&lt;/li&gt;
&lt;li&gt;o segundo para que o &quot;Subtotal&quot; fosse exibido no final de cada segmento da coluna &quot;produto&quot; independente da ordem alfabética;&lt;/li&gt;
&lt;/ul&gt;
Após a execução da sentença, teremos o resultado exibido a seguir:&lt;br /&gt;
&lt;br /&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;/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/AVvXsEiRwDnH7sedLZ1vlsVzthTL78IL31KG7qN3uMsv8BvDnwF6Ob3CkxJuhsK-xKKGiGR1PgX_bREF5c0eakk4fZk37OH_e4fCKLBmHlSwgIVKngobWA-Ysxmppc0IVVGDLtuxZuThRucPv0U/s1600/artigo_oracle_rollup_img_4.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRwDnH7sedLZ1vlsVzthTL78IL31KG7qN3uMsv8BvDnwF6Ob3CkxJuhsK-xKKGiGR1PgX_bREF5c0eakk4fZk37OH_e4fCKLBmHlSwgIVKngobWA-Ysxmppc0IVVGDLtuxZuThRucPv0U/s1600/artigo_oracle_rollup_img_4.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;b style=&quot;color: #741b47; font-family: Arial, Helvetica, sans-serif;&quot;&gt;Deixe o seu comentário ou sugestão.&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;b&gt;Gostou?&amp;nbsp; Siga no Google +&amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: small;&quot;&gt;ou Facebook&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;.&lt;/b&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://jquerydicas.blogspot.com/feeds/8713675191469075038/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://jquerydicas.blogspot.com/2015/02/oracle-calcular-total-subtotal-com.html#comment-form' title='2 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/8713675191469075038'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7010404629734647455/posts/default/8713675191469075038'/><link rel='alternate' type='text/html' href='http://jquerydicas.blogspot.com/2015/02/oracle-calcular-total-subtotal-com.html' title='ORACLE - Calcular total /subtotal com ROLLUP'/><author><name>Kelly</name><uri>http://www.blogger.com/profile/03449060135636479990</uri><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/AVvXsEhePH7d1N6MDzXvAPZhGIf93X7Q3QEByAZQv_XUQjANcKYEaVzm2bTR3saJYv9bhckww6-TInqJ_uxwYUggfeVKoa5FV2YEIuhr8xW0X6Vf7CTpbq-DqliAPxO4YHQzDGsj2vhA4tVGQak/s72-c/artigo_oracle_rollup_img_tab_fornecedor.png" height="72" width="72"/><thr:total>2</thr:total></entry></feed>