iEntry 10th Anniversary Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > Putting it Together > Databases

Reply
 
LinkBack Thread Tools
Old April 30th, 2009, 07:47 PM   #1
WebForumz Member
 

Join Date: Sep 2005
Location: athens
Age: 27
Posts: 69
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 ktsirig is on a distinguished road
Question on numeric data types in Mysql

Hello all!
I have a field in my Mysql db which can store various numeric types, like 123, -45.74423, 23e-56 etc, and for those numbers, I can't know if they will be float, integers, positive or negative or how many decimal digits they may have.
My question is, should I use something like VARCHAR (100) as data type for this column?
If, in a query, I want to select all numbers that are >50 for example, will the comparison work or there will be a problem because I would have stored the numbers as VARCHAR?

Please advice!
ktsirig is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old May 1st, 2009, 10:51 AM   #2
WebForumz Member
 

Join Date: Jun 2007
Location: Birmingham, UK
Posts: 56
Thanks: 0
Thanked 1 Time in 1 Post
Rep Altering Power: 0 hschmitz is on a distinguished road
Re: Question on numeric data types in Mysql

In most cases the DOUBLE PRECISION data type should be enough. If I remember correctly it has up to 14 significant digits and can store numbers up to approximately 1e300. Of course you can also store integers.
hschmitz is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
mysql data loads once user login longstand PHP 9 February 7th, 2008 04:10 AM
MYSQL/PHP Query question andrewlondon Databases 1 September 19th, 2007 08:26 AM
inserting data to mysql db Tim356 PHP 1 May 6th, 2005 01:20 AM
MySql Question Audioz Databases 6 February 25th, 2005 10:35 AM
recordset constants (data types) spinal007 Classic ASP 6 September 19th, 2004 04:39 AM


Search Engine Optimization by vBSEO 3.2.0 RC8