[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] int(11) i mysql



Jørgen Heesche wrote:
Peter Makholm wrote:

Atte André Jensen <sslug@sslug> writes:


Peter Makholm wrote:


Det er altså ren fremvisning


Der det ikke meget mærkeligt at gemme visning som en del af typen?



Det er IMHO meget mærkeligt at en sql-database bekymre sig om fremvisning.

Nej, det er slet ikke mærkeligt, store værdier bliver trunkeret til M digits ved udskrivning med 'select *'. Sådan en tabel-udskrivning ville ellers blive ødelagt, hvis der i en kolonne forekommer enkelte meget store tal; kolonnen bliver unødigt bred.


Der er lidt for meget gætteri i ovenstående. Kolonnebredden retter sig efter hvor mange printpositioner det største tal i kolonnen skal bruge.
I typeerklæringen int(11) er 11 default-værdien. Den angiver at den maksimale numeriske værdi af en integer fylder 11 printpositioner inklusive fortegn. Man kan godt definere int(5), men nysql er ligeglad, det begrænser ikke værdiområdet, som er -2147483648 til 2147483648, eller 11 printposiotioner.
Se: http://dev.mysql.com/doc/refman/4.1/en/numeric-types.html


--
Med venlig hilsen

Jørgen Heesche
mailto:sslug@sslug
Registered Linux User #401007


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2006-04-01, 02:01 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *