Logo
  •   Home
  •   Wiki
    •   Linux
    •   Joomla!
    •   PHP
    •   VB.NET
    •   SQL
    •   HTML
    •   Crystal Reports
    •   Varie
    •   C#
< >

Joomla!

Leggi tutto...

Linux

Leggi tutto...

SQL

Leggi tutto...

ASP.NET

Leggi tutto...

VB.NET

Leggi tutto...

PHP

Leggi tutto...

Crystal Reports

Leggi tutto...

HTML

Leggi tutto...

C#

Leggi tutto...

Decrementare/Incrementare un valore

  • Categoria: SQL
  • Stampa
  • Email
Offrimi un Caffè

 

Se si desidera incrementare o decrementare il valore di un campo verificando che il numero non sia negativo, una possibile soluzione è la seguente:

UPDATE table SET campo1 = campo1 - 1,
                           campo2 = campo2 - 1

WHERE
campo1 >0;

Menu Example

  •   Getting Started
  •   The Joomla! Project
  •   The Joomla! Community
  •   Another link

Ultimi Articoli

  • Contrassegnare un Metodo come Obsoleto o Deprecato
  • Verificare se una stringa rappresenta un valore numerico
  • Verificare se una stringa rappresenta un valore numerico
  • Restituire un range di record di una SELECT
  • Raspberry - Aprire un file in LibreOffice Impress da console

Login

Copyright (c) www.colussimarco.it 2018. All rights reserved.
Designed by mixwebtemplates.com