Pubblicato da: mrighelli | febbraio 6, 2009

Ma la logica booleana?

Provate ad eseguire il seguente codice SQL su SqlServer… ma la logica booleana che fine ha fatto?

DECLARE @Param1 INT, @Param2 INT
SET @Param1 = NULL
SET @Param2 = NULL

IF (@Param1 = @Param2)
PRINT ‘EQUAL’
ELSE
PRINT ‘NOT EQUAL’

IF NOT(@Param1 = @Param2)
PRINT ‘EQUAL’
ELSE
PRINT ‘NOT EQUAL’

il risultato per entrambe รจ ‘NOT EQUAL’


Lascia un Commento

Fill in your details below or click an icon to log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Log Out / Modifica )

Foto Twitter

You are commenting using your Twitter account. Log Out / Modifica )

Foto di Facebook

You are commenting using your Facebook account. Log Out / Modifica )

Connecting to %s

Categorie

Follow

Get every new post delivered to your Inbox.