Senhores,
Estou com uma consulta no access e ela me deu uma tabela assim:
COD NOME CLASS
50 JOÃO A
50 JOÃO B
45 JOSÉ D
45 JOSÉ A
PRECISO DE UM CRITÉRIO NO COD PARA NÃO DUPLICAR E A TABELA FICAR ASSIM:
COD NOME CLASS
50 JOÃO A
45 JOSÉ D
Distinct
Started By KwmT, 19/03/2009, 09:07
1 reply to this topic
#1
Posted 19/03/2009, 09:07
#2
Posted 19/03/2009, 10:12
tem um problema se a class for diferente vai duplicar!
você tem dois modos
select distinct
COD, NOME, CLASS from tabela
ou
select
COD, NOME, CLASS
group by COD, NOME, CLASS
você tem dois modos
select distinct
COD, NOME, CLASS from tabela
ou
select
COD, NOME, CLASS
group by COD, NOME, CLASS
====================================================
Diego M.
Html, CSS, Javascript, Asp, Asp.net, Php, Sql Server, Mysql, Oracle, VB.NET, VBA
====================================================
Diego M.
Html, CSS, Javascript, Asp, Asp.net, Php, Sql Server, Mysql, Oracle, VB.NET, VBA
====================================================
1 user(s) are reading this topic
0 membro(s), 1 visitante(s) e 0 membros anônimo(s)