Você está na página 1de 2

Banco De Dados SQL

SELECT:
select*from Marca = * retorna todos pertencentes a Marca select*from Marca where codigo > 0 orderby codigo desc = Idem anterior + em

ordem decresente, codigo nico, no necessrio select codigo,id from Marca = Mostra s as colunas informadas select codigo,id from Marca orderby id = Idem anterior + em ordem crescente por id
select*from Marca where id = 2 and Nome ='Ricardao' selectcase UnidadeMedida when 0 then'00 - M3'when 1 then'01 - KG'when 2 then'02 TON'when 3 then'03 - UN'when 4 then'04 - LT'endas UnidadeMedida , Controle, ControleCTE , TipoMedida , Quantidade from ConhecimentoQtde = No Registro est

gravado o Cdigo 0 Por Exemplo e no gride da tela vai mostrar 00 M3.


selectcase UnidadeMedida when 0 then'00 - M3'when 1 then'01 - KG'when 2 then'02 TON'when 3 then'03 - UN'when 4 then'04 - LT'endas UnidadeMedida , Controle from ConhecimentoQtde ExSql tblConhecimentoQtde, " selectcase UnidadeMedida when 0 then'00 - M3'when 1 then'01 - KG'when 2 then'02 - TON'when 3 then'03 - UN'when 4 then'04 - LT'endas UnidadeMedida , TipoMedida , Quantidade from ConhecimentoQtde where ControleCTE = " & tblCadastro!Controle select*from ConhecimentoQtdeNF select unidademedida ,tipomedida ,sum(quantidade )as quantidade from ConhecimentoQtdeNF innerjoin ConhecimentoNF on ConhecimentoNF .Controle = ConhecimentoQtdeNF .controlenf where controlecte = 10190000939 groupby unidademedida ,tipomedida

NUMERO DE REGISTROS QUE A TABELA CONTEM: selectcount(0)from ConhecimentoQtde


Ou selectcount(Controle)from ConhecimentoQtde

MAIOR QUANTIDADE = selectmax(Quantidade )from ConhecimentoQtde MENOR QUANTIDADE = selectmin(Quantidade )from ConhecimentoQtde

INSERT:
insertinto Marca (Codigo,Nome,OperadorAlt ,id)values(1,'Eu Aki',2,99);=PREENCHE OS

CAMPOS COM OS RESPECTIVOS VALORES

UPDATE:
update Marca set id = 99 where codigo = 1 = Alterar update Marca set id = 3,Nome ='Teste'where codigo = 1

DELETE:
deletefrom Marca where id = 99 and codigo = 1= Na tabela Marca , as linhas que tiverem id=99 e codigo=1 so removidos deletefrom Marca where (id = 99 and codigo = 1) or id = 99 = Deleta quando pelo menos uma das duas clausulas so satisfeitas deletefrom Marca where (id = 99 and codigo = 1) or (id = 99 and codigo = 1 ) = Idem anterior

OBS.:

 S O SELECT TEM *.  MUITA ATENO NO COMANDO DELETE(DANGER).

Você também pode gostar

  • Resumo PmBok
    Resumo PmBok
    Documento2 páginas
    Resumo PmBok
    edeued934
    Ainda não há avaliações
  • trabII 2012 01
    trabII 2012 01
    Documento1 página
    trabII 2012 01
    edeued934
    Ainda não há avaliações
  • Aula 5
    Aula 5
    Documento1 página
    Aula 5
    edeued934
    Ainda não há avaliações
  • Aula 3
    Aula 3
    Documento1 página
    Aula 3
    edeued934
    Ainda não há avaliações
  • Mandar Email
    Mandar Email
    Documento7 páginas
    Mandar Email
    edeued934
    Ainda não há avaliações
  • Me Chart
    Me Chart
    Documento1 página
    Me Chart
    edeued934
    Ainda não há avaliações