MySQL Forums
Forum List  »  Newbie

Re: equal to 0 if negative
Posted by: laptop alias
Date: March 10, 2009 05:56PM

How about...?
CREATE TABLE test (score INT UNSIGNED);

INSERT INTO test VALUES (1);
INSERT INTO test VALUES (0);
INSERT INTO test VALUES (-4);

SELECT * FROM test;
+-------+
| score |
+-------+
|     1 |
|     0 |
|     0 |
+-------+

Options: ReplyQuote


Subject
Written By
Posted
March 10, 2009 05:17PM
Re: equal to 0 if negative
March 10, 2009 05:56PM
March 10, 2009 06:02PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.