Skip navigation links

MySQL Forums :: General :: search for query that result one random url from domain


Advanced Search

Re: search for query that result one random url from domain
Posted by: laptop alias ()
Date: December 09, 2011 06:31AM

>its the length of the integer...
>is use it like a bool, where it is set to 1

Not exactly. Depending on the exact configuration, INT supports values in the range -2147483648 to 4294967295, i.e.INT(11). INT(100) is then a nonsense. In fact, defining the scale of INT at all only makes sense in the context of a ZEROFILL declaration, which can in any case be simulated through another process.

By way of illustration...

CREATE TABLE my_ints(i3 INT(3) ZEROFILL,i5 INT(5) ZEROFILL);

INSERT INTO my_ints VALUES (1,1),(2,2),(3,3),(1000,100000);

SELECT * FROM my_ints;
+------+--------+
| i3   | i5     |
+------+--------+
|  001 |  00001 |
|  002 |  00002 |
|  003 |  00003 |
| 1000 | 100000 |
+------+--------+

Again, depending on configuration, TINYINT supports values in the range -128 to 255. As it only requires 1-byte storage (as opposed to the 4-byte storage of INT) it's a much better candidate for your bool.



Edited 1 time(s). Last edit at 12/09/2011 06:31AM by laptop alias.

Options: ReplyQuote


Subject Written By Posted
search for query that result one random url from domain Bernd Meier 12/03/2011 07:52PM
Re: search for query that result one random url from domain Bernd Meier 12/04/2011 04:04PM
Re: search for query that result one random url from domain laptop alias 12/05/2011 05:39AM
Re: search for query that result one random url from domain Bernd Meier 12/05/2011 06:42AM
Re: search for query that result one random url from domain laptop alias 12/05/2011 07:55AM
Re: search for query that result one random url from domain Bernd Meier 12/05/2011 04:06PM
Re: search for query that result one random url from domain laptop alias 12/05/2011 06:28PM
Re: search for query that result one random url from domain Bernd Meier 12/05/2011 07:08PM
Re: search for query that result one random url from domain Rick James 12/06/2011 11:59PM
Re: search for query that result one random url from domain laptop alias 12/07/2011 03:24AM
Re: search for query that result one random url from domain Bernd Meier 12/08/2011 08:56PM
Re: search for query that result one random url from domain Rick James 12/08/2011 10:02PM
Re: search for query that result one random url from domain Bernd Meier 12/09/2011 05:31AM
Re: search for query that result one random url from domain laptop alias 12/09/2011 01:53AM
Re: search for query that result one random url from domain Bernd Meier 12/09/2011 04:42AM
Re: search for query that result one random url from domain laptop alias 12/09/2011 06:31AM
Re: search for query that result one random url from domain defor rest 12/09/2011 07:08AM


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.