LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-16-2014, 09:33 PM   #16
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,908

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513

Quote:
Originally Posted by jkirchner View Post
Correct I always try to think what I want to get out of the databases so I can best figure out how to set them up. That rule of make the fields numbers if you ever want to do math with them is a good one. Saves extra effort later.
It also saves time - queries on numbers is much faster than varchar.

It also eliminates the possibility of errors - you can't store a string in a number...
 
Old 08-19-2014, 03:18 PM   #17
fixer1234
Member
 
Registered: Aug 2014
Location: Virginia, USA
Posts: 51

Rep: Reputation: Disabled
Quote:
Originally Posted by jkirchner View Post
Correct I always try to think what I want to get out of the databases so I can best figure out how to set them up. That rule of make the fields numbers if you ever want to do math with them is a good one. Saves extra effort later.
Exactly. If you are in a situation where you can't just go back and requery the original data to get it in numerical form, I would avoid continually working with substring functions on every record every time you use it. Do it once to create a new field where everything is numeric. Then work with that field.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Usage of /dev/null minus signs instead of greater-than signs keif Programming 6 10-20-2013 12:41 PM
How to multiply columns and add them from a file? Niteawk Linux - Newbie 13 02-19-2013 01:51 AM
multiply two numbers in Linux script Ghazale Linux - Newbie 5 10-12-2011 09:06 PM
Replacing selected columns by Serial numbers incremently raghu123 Programming 8 08-25-2008 02:27 AM
Doing arithmetics on columns of numbers hhegab Programming 2 03-08-2006 10:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration