Selecionar Registros Duplicados – SQL

18 11 2008

Problema

Haviam algumas empresas com cadastros duplicados e eu queria saber quais eram elas.

Solução

SELECT
    emp_cnpj,
    count(*)
FROM empresa
WHERE
   emp_cnpj <> ''
GROUP BY emp_cnpj
HAVING COUNT(*) > 1
Anúncios

Ações

Information

32 responses

8 10 2009
Vinicius Oliveira

Olá!! criei uma software para selecionar registros duplicados em tabelas SQl, atualmente funciona para Oracle, MYSQL, SQL Server, Postgre. ai tá o link do projeto no sourceforge https://sourceforge.net/projects/locatorduplicat/files/

Vinicius Oliveira
vraoliveira@gmail.com

6 09 2011
Lucas

Show…

11 11 2011
Lierce Santos

Lindo lindo lindo… shuoahsuhouhsa’

23 12 2011
Daniel

Como faço para exibir apenas um dos dos registros q estão duplicados?

4 04 2012
portalunibarretos

#Daniel,

para exibir apenas um registro duplicado digite assim:

SELECT emp_cnpj, count(*) FROM empresa WHERE emp_cnpj ” GROUP BY emp_cnpj HAVING COUNT(*) > 1 LIMIT = 1;

10 07 2012
Alexandre

muito bom,
obrigado pela ajuda.

2 08 2012
Marcos Vinícius Correia da Silva

Obrigado!
Simples e funcionalmente elegante

4 10 2012
RFdexunda

Ансамбль “РУССКОЕ ПОЛЕ” – это уникальное музыкальное шоу с нестандартным подходом, оформленной в этническом духе и связанной единой музыкальной драматургией. Музыка ансамбля “РУССКОЕ ПОЛЕ” разносторонняя, наряду с национальными инструментами, баян, балалайка, жалейки, дудки – задействован инструментальный спектр многих современных музыкальных направлений. Добавьте к этому красивый народный вокал и этнические динамические ритмы! Это представление, в полном контакте с публикой – скетчи, пародии, сценки, а главное, попурри на самые известные произведения 19-20 века. Это и веселый юмор, переодевания и шутки способные развеселить и потешить любого зрителя. Заказать артиста на корпоративное мероприятие или юбилей предполагает включение в программу популярных застольных песен. Куда же без них! Но если это городское мероприятие или фестиваль – заказ артистов на праздник включает обязательную танцевальную часть суенария, где уклон направляется на национальные ритмы, либо народные песни с плясовыми ритмическими аранжировками. Музыканты на свадьбу или кавер группа на корпоратив! – вам стоит заказать артистов ансамбля “РУССКОЕ ПОЛЕ”, чтобы убедится, что празднование события пойдет, как надо – комфортабельно и незабываемо! Музыкальные коллективы города Москва и кавер группы Москвы, как правило, традиционны и оригинальны, но когда на сцену выходит ансамбль РУССКОЕ ПОЛЕ, радость охватывает всякого, кто находится в зале! Мы поем традиционный фольклор, русские народные песни, песни советских композиторов и авторские песни новой России, показывая свое творчество на встречах иностранных и VIP гостей. Ансамбль очень много экспериментирует в жанре народной музыки и активно сотрудничает с различными музыкантами.

РУССКОЕ ПОЛЕ – кавер группа на корпоратив

27 02 2014

Falou tudo!!!

4 10 2012
duduindo

Obrigado Véy..
porra.. ajudou pra caralius..

#vixe véy… vc é o cara..
puta-merda.. obrigado mesmo.

Abraços.

30 11 2012
Marco Pretão (@pretaobh)

Estava a tempo precisando de um exemplo para resolver meus problemas.

Obrigado solucionou 95% do meu trabalho manual hahahahahaha

13 03 2013
Rodrigo Souza

Pessoal, tenho uma tabela que registra ‘N’ informações, entre elas atualizações, exemplo:

cd_pro nome valor dt_vigencia
01 teste 1,00 21/02/2012
02 maria 5,00 03/01/2011
01 teste 1,50 21/05/2012

No caso acima o registro de cd_pro 01 foi apenas atualizado.
Preciso de fazer uma consulta que me apresente qual foi a ultima atualização de cada cod_pro. No caso acima deveria apresentar apenas duas informações, o cd_pro 02 e ocd_pro 01 com atualização em 21/05/2012

Será que alguém consegue me ajudar?

10 04 2013
vpvmqmcp

Fujian of 2 events of huge struggle delivers Shandong male gift basket to create couplet easily to be handled again upon Wang Zhelin
Head into ancestor productive fitness center, wang Zhelin’s poster is designated even more, on Jan A couple of at night, shandong guy holder may obstacle this particular skill early youngsters below. Whether keep within just boundaries lifestyles Wang Zhelin, the true secret in wholesale Jordans which becomes Shandong team to look at subsequent contests.
“I view his or her game for the first time, the initial circular become this particular athletics time of year, fujian group suggest the match up of area and also Qingdao, wait me to convey based on the coaching split which employs myself during those times, this particular adolescent can become quite fantastic, he or she should be Alright type in NBA. He’d the particular endowment that will gets into Nba along with foundation, wish to be able to perform right training merely, I believe have an overabundance when compared with is necessary is simply too lengthy, maybe 3 years a pair of, we will see his figure in National basketball association. In . Mabuli can be evaluated to be able to Wang Zhelin.
Although be CBA recipe chicken only, wang Zhelin however previously fame is exterior. Goal This year, oriental holder aid introduced brand new list of construct for instruction involving men gift basket of an The far east, on Wangzhe natrual enviroment a listing of titles posted up of 18 years old famous. Despite the fact that regret the bottom manages to lose a good election ultimately Olympic Games identify is solitary, he or she ‘s still within up coming guy Lan Yaqing will be surpassed on, an individual associated with amazing powers which go friends takes Being unfaithful Lian Shengcheng give you shield the queen’s. Depend upon good chance of Wang Zhelin, before athletics time of year, fujian establish the target developing a series that is essence along with Wang Zhelin. Latest, within the Fifteen CBA video game which has enjoyed, master sagacious forestry centre most features 19.Three or more minutes regarding 14.Your five bank key in a specific thing within an bank account, its act a little any no less than overseas aids. Photograph looking at mosts in parent Yao Ming and Wang Zhi, dish hen period involving Wang Zhelin can be probably none inferior.
Aside from Wang Zhelin smart along with healthy, wheat or grain of a selected and planted broker triumphs over Fujian Donna number Zhuang Shuo, strength is very, twice structure involving team planted adviser gets Fujian bust metropolis for you to disconnect the edge instrument involving stockaded village, speak to repeatedly to near future rooted realtor the actual Shandong associated with examination, search engine optimization gainesville complement is really a difficult battle without doubt. Involving chance will be, abasibenchangbi exceeds outdated worry revisit, small stop within Wang Zhelin grown broker a brutal struggle. The newest partner associated with Fujian staff and also outdated enjoy may chafe a what type of scintilla, be worth to expect very.
Connected information

25 04 2013
22 08 2013
Dirceu Silva de Oliveira

Muito obrigado me ajudou muito. E como faço pra classificar os que mais tem registro primeiro, depois em segundo e assim por diante?

14 09 2013
T'

Como faço para retornar todos os registros sem a duplicação?

11 10 2013
azazalolxd

Hello pals! :)))

13 11 2013
ghpokklast

1

25 11 2013
José

Mano, muito obrigado!!!

26 11 2013
pletcherhfb

the nba will start advertising replica as well as swingman jerseys intended for

Additionally, the DJs have provided true apology. Received plus accepted. Just about everyone has made problems in this existence. Letizia Moratti also will not care, did not lose so that you can Chievo after a favorable at the beginning of 12 months excited brief review; fans significantly less care, think one thousand 700 and 80 fourninety fifths season UEFA Tumbler loss in order to Lugano’s history, stated Lugano with New jersey Inter Milan 11 makes us miserable. 0: isn’t disaster, reviewing are in numerous young people played with second half was created, finished Shi Jameel ZANETTI, and Cordoba, and also Jonathan, and kudiniao, and Zarate, and Castanos 7 a firstline people presence, just SAteam a batman main, left over 5 people or long term injuries (keerduobaxin year or so also is not debut, weekend break on Catania recovery, Lucio midway quit injuries pending) or far too young or maybe technology features remains to be seen observation, tend to be has won’t inflow involving bruising. In the short term, inter aren’t going to be news, Tinker is restorative method, was to return to typical by inter.

Thigh shields began to become of tougher materials, though knee parts began to come in of foam. A pants were also designed with interior “pockets” to hold on to the parts in place. Trendy and tailbone pads were additionally made of large foam, and then hard materials, as know-how improved.

That is exactly why Favre exited retirement (just as before) and signed up with the Vikings. Today he’s on course home to your bayou with a further chance to go to the Super Tank. Favre threw several TD passes in the postseason game in my ballet shoes in the romp of Houston, proving which despite their cache of records, he or she still hasn’t already done all..

new nike nfl uniforms 2013

30 11 2013
carpinteyrozlb

as royal respectable favorite activity

In 2001, the team began wearing purple pants utilizing their white nhl jerseys.. This is a significant day for your Chargers, the area of Huntsville, the actual conference on its own and college or university hockey generally. Without having a Stanley Marijuana, we will have got a nice adventure along with attached with recollections from the The year 2010 Literature, but next to nothing celebrated..

Consider doing factors a bit ‘different this coming year, if you are looking for different results as compared with you had prior to now. The participants are presented to a crowd up to 200 using a uniformed officer that runs their house club, termed as “commandant.” Princesses walk through a collection of uniformed commandants saluting them.

These kind of jerseys are generally produce regarding thinner materials with less detail in order that they a lot less high-priced.. And to top it all down we get any title game that seems so last night. LF Carlos Quentin was put on paternity get away from Friday. “He has just a workmanlike strategy,” Sgroi says of Seymour.

Man Wolff hung his or her shingle throughout 1971, within a little barn within Bantam, Conn. Most of the NBA. Trophies are found symbols of their particular winning plus achievement, it’s regarded as an amazing memory of your game or one important period of lifestyle.. The New york yankees had being unfaithful homers in their preceding four online games, all up against the Twins.

He has got also bought a ticket from Virgin Galactic Air passages to take a flight into suborbital space in 2013.. She took: when I listened to this stupidassed comment by Axelrod] who knew me, because I had helped American talk about controller] Carl McCall when he jogged for governor to call me a racial I was similar to a lunatic.

jerseys wholesale onlinE

2 12 2013
SoblreodelP

Сразу попрошу прощения модераторов, но не похвалиться не могу )))
Долго думал и искал нужный CMS для своего первого видеотуба и вот наконец конечный результат готов.
Кардинально новый видеотуб, поддерживается воспроизведение на всех устройствах и на мобильных в том числе !!
Выбор качества для пользователей и очень удобная навигация.
Прошу оценить и не пинать сильно )) Кто что скажет о первом моем сайте ?
Собсно вот сам сайт, ка бы то его показать, чтоб без ссылки )) думаю так будет нормально _ http://soblaznu.net

19 12 2013
ProChermmic

Сразу попрошу извинения модераторов, но не похвастаться не могу )))
Долго думал и искал нужный движек для своего первого туба и вот наконец конечный результат готов.
Кардинально новый видеотуб, поддерживается воспроизведение на всех девайсах и на мобильных в том числе !!
Выбор качества для посетителей и очень удобная навигация.
Прошу оценить и не пинать сильно )) Кто что думает о первом моем сайте ?
Собсно вот сам сайт, ка бы то его показать, чтоб без ссылки )) думаю так будет нормально _ http://soblaznu.net

27 02 2014
drbrainpower

hello world

11 03 2014
MarcelSinc

111

15 03 2014
AentesiaUnak

Как дела?:)

22 03 2014
rodfgferst

sdsdsds

14 07 2014
Gusfo

como visualizo quais são os repetidos???

14 07 2014
HesZoornon

Hello
Tell me please…
How to prevent Diabetes?
Thanks you

12 10 2014
Webmoneydow

Вывод вебмани наличными и на карту сбербанка

9 12 2014
Tabela Reklam

Tabela Reklam

Selecionar Registros Duplicados – SQL | Anselmo

14 12 2014
WilliamDus

Ах ты засранец че смотришь в эту тему. Теперь я владелец этого форума!!!
http://ya.ru

Deixe um comentário

Preencha os seus dados abaixo ou clique em um ícone para log in:

Logotipo do WordPress.com

Você está comentando utilizando sua conta WordPress.com. Sair / Alterar )

Imagem do Twitter

Você está comentando utilizando sua conta Twitter. Sair / Alterar )

Foto do Facebook

Você está comentando utilizando sua conta Facebook. Sair / Alterar )

Foto do Google+

Você está comentando utilizando sua conta Google+. Sair / Alterar )

Conectando a %s




%d blogueiros gostam disto: