Tag Info

New answers tagged

0

Maybe erical already has two columns that keep the "home score and away score as two separate int fields", as Mark and Phil already commented. Then, the remaining part of the question would be whether it is possible to create a user-defined type for a separate string column that stores the match result for faster printing. So, the answer in this situation ...


1

However oracle keeps making my numbers 22 bytes long This assumption is wrong. Values stored in a NUMBER column take up only as much space as needed. Quote from the manual A NUMBER value requires from 1 to 22 bytes (emphasis mine) This can be validated using the VSIZE() function: create table foo (id number(22), some_value number(22,8)); ...


1

See here ixora. Number has variable length, like string. each digit occupies one nibble (4bits, half byte) NUMBER implementation is platform independent you can validate size of number value in a culumn by calling dump() function PS: Oracle also supports native intergers like PLS_INTEGER, but these can only be used in PL/SQL context only.


3

My educated guess (while proper information is missing): You declared bin_number as character(n), char(n) or just char data type. character(n) is an outdated, inefficient, weird data type, but defined in the SQL standard. char (without double quotes!) or char(1) are aliases for character(1). Typically you do not want to use it. It's a blank-padded data ...


2

There is at least one case where bin_number <> '' is handled differently in MySQL and PostgreSQL. It's when the string only contains spaces. Check out this earlier answer that sheds a light to the MySQL side of things. PostgreSQL: SELECT '' <> ' ' true MySQL: SELECT '' <> ' ' false Usually when the statement contains LIKE the ...


0

You are best to start with a transactional database that records the data in as much detail as you can get from the source. You can always summarize and report from detailed data, but you can't go backwards from summary information to detailed information. If you are getting data in the form: transaction_date datetime , pallets_taken_in int , ...



Top 50 recent answers are included