Re: Using INTEGER instead of VARCHAR/DATE - is this a way to faster access?

2014-11-06 Thread Zbigniew
2014-11-06 21:49 GMT+01:00, Roberta Jaskólski : > Ugh--I missed the discussion shift from the DATEs to the VARCHAR labels ... > and now I wholeheartedly agree with you. > > As for the DATEs, I yet suspect that for performance maybe TIMESTAMP is > slightly better than DATE. Well what I'm interest

Re: Using INTEGER instead of VARCHAR/DATE - is this a way to faster access?

2014-11-06 Thread Roberta Jask�lski
2014/11/04 11:04 -0800, Jan Steinman I was not suggesting it for dates. The OP appeared to have a well-defined set of strings in a VARCHAR field — THAT is what I suggested ENUMs for! What is the update frequency of those VARCHARs? If you're adding them often — or if you need to

Re: Using INTEGER instead of VARCHAR/DATE - is this a way to faster access?

2014-11-04 Thread Jan Steinman
> From: (Halász Sándor) h...@tbbs.net > >>>>> 2014/10/29 20:56 +0100, Zbigniew >>>> > if instead of textual labels I'll use SMALLINT as simple integer "code" for > each different "label" (and in my program a translation table)?

Re: Using INTEGER instead of VARCHAR/DATE - is this a way to faster access?

2014-11-04 Thread Johan De Meersman
- Original Message - > From: "Zbigniew" > Subject: Using INTEGER instead of VARCHAR/DATE - is this a way to faster > access? >> What about using ENUMs? They have nearly the performance of INTEGERs, but >> you don't have to maintain a string mapping

Re: Using INTEGER instead of VARCHAR/DATE - is this a way to faster access?

2014-11-03 Thread Hal�sz S�ndor
the cost of any single comparison. The equality comparison is at least simpler than an ordered comparison. >>>> 2014/10/29 20:56 +0100, Zbigniew >>>> if instead of textual labels I'll use SMALLINT as simple integer "code" for each different "label

Re: Using INTEGER instead of VARCHAR/DATE - is this a way to faster access?

2014-11-02 Thread Jan Steinman
> From: Zbigniew > >> switching from DATE to "more numeric" data type may not be necessary... I would hope that the query optimizer converts '2014-11-02' to the three-bytes internal representation of DATE before doing the query, in which case, DATE should actually be a tiny bit faster than TIM

Re: Using INTEGER instead of VARCHAR/DATE - is this a way to faster access?

2014-11-02 Thread Zbigniew
2014-10-31 5:29 GMT+01:00, Jan Steinman : > What about using ENUMs? They have nearly the performance of INTEGERs, but > you don't have to maintain a string mapping in your programming logic. So you guys (Jan and "hsv") suggest, that switching from DATE to "more numeric" data type may not be neces

Re: Using INTEGER instead of VARCHAR/DATE - is this a way to faster access?

2014-10-30 Thread Jan Steinman
> From: Zbigniew > > Now to the point: considering, that the second column shall contain > about 100-200 different "labels" - so in average many of such labels > can be repeated one million times (or even more) What about using ENUMs? They have nearly the performance of INTEGERs, but you don't

Re: Using INTEGER instead of VARCHAR/DATE - is this a way to faster access?

2014-10-30 Thread Jan Steinman
> From: Zbigniew > > Now to the point: considering, that the second column shall contain > about 100-200 different "labels" - so in average many of such labels > can be repeated one million times (or even more) What about using ENUMs? They have essentially the performance of INTEGERs, but you

Re: Using INTEGER instead of VARCHAR/DATE - is this a way to faster access?

2014-10-30 Thread hsv
done with something like "...WHERE label='xyz' AND date='2013-02-25' " (and maybe the insertion as well?), if instead of textual labels I'll use SMALLINT as simple integer "code" for each different "label" (and in my program a translation table)?

Using INTEGER instead of VARCHAR/DATE - is this a way to faster access?

2014-10-29 Thread Zbigniew
will it speed-up the selection done with something like "...WHERE label='xyz' AND date='2013-02-25' " (and maybe the insertion as well?), if instead of textual labels I'll use SMALLINT as simple integer "code" for each different "label" (and in my

Re: Long integer constant problem in views

2013-04-30 Thread hsv
2013/04/30 17:17 +0200, Martin Koch CREATE OR REPLACE VIEW foo AS SELECT * FROM mytable WHERE id = X'36a461c81cab40169791f49ad65a3728'; Try this: _binary X'36a461c81cab40169791f49ad65a3728' SHOW CREATE VIEW is the command for the client. -- MySQL General Mailing List Fo

RE: Long integer constant problem in views

2013-04-30 Thread Rick James
WHERE id = UNHEX('36a461c81cab40169791f49ad65a3728') > -Original Message- > From: Martin Koch [mailto:m...@issuu.com] > Sent: Tuesday, April 30, 2013 8:18 AM > To: mysql@lists.mysql.com > Subject: Long integer constant problem in views > > Hi List > &

Long integer constant problem in views

2013-04-30 Thread Martin Koch
Hi List I have a table with a primary key with type binary(16) and a few columns. I'd trying to create a view that looks up all rows with a particular key, i.e. something like CREATE OR REPLACE VIEW foo AS SELECT * FROM mytable WHERE id = X'36a461c81cab40169791f49ad65a3728'; I use the mysq

Re: function to limit value of integer

2011-02-11 Thread Riebold, Philip
avis >>> >>> -Original Message- >>> From: Richard Reina [mailto:gatorre...@gmail.com] >>> Sent: Thursday, February 10, 2011 3:07 PM >>> To: mysql@lists.mysql.com >>> Subject: function to limit value of integer >>> >>&g

Re: function to limit value of integer

2011-02-11 Thread Johan De Meersman
ng > > system you want to use. > > > > -Travis > > > > -Original Message- > > From: Richard Reina [mailto:gatorre...@gmail.com] > > Sent: Thursday, February 10, 2011 3:07 PM > > To: mysql@lists.mysql.com > > Subject: function to limit valu

Re: function to limit value of integer

2011-02-11 Thread Richard Reina
gt; -Travis > > -Original Message- > From: Richard Reina [mailto:gatorre...@gmail.com] > Sent: Thursday, February 10, 2011 3:07 PM > To: mysql@lists.mysql.com > Subject: function to limit value of integer > > Is there a function that can limit the value of an integer i

RE: function to limit value of integer

2011-02-10 Thread Travis Ard
l.com] Sent: Thursday, February 10, 2011 3:07 PM To: mysql@lists.mysql.com Subject: function to limit value of integer Is there a function that can limit the value of an integer in a MySQL query? I am trying to write a query that scores someones experience. However, number of jobs can b

function to limit value of integer

2011-02-10 Thread Richard Reina
Is there a function that can limit the value of an integer in a MySQL query? I am trying to write a query that scores someones experience. However, number of jobs can become overweighted in the the query below. If someone has done 10 jobs vs. 1 that's a big difference in experience. But so

Finding the max integer using MySQL.

2010-04-20 Thread Alister West
Hi there, I would like to find out the maximum (signed or unsigned) integer from MySQL. SELECT CAST( POW(2,100) as UNSIGNED) as max_int; # max_int | 9223372036854775808 This seems to be a MAX_BIGINT from the lookup table at http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html Is there a

Re: UNHEXING to integer (as opposed to a string)...

2010-02-28 Thread mysql.l...@juun.com
le bit doesn't make sense, logically: "The hex string is in little endian byte order (since it represents a 2-byte integer or short)"... What I was trying to say is that the integer that this hex string represents is multi-byte, so the order of the hex bytes **is** important... b

Re: UNHEXING to integer (as opposed to a string)...

2010-02-28 Thread mysql.l...@juun.com
Oops: This little bit doesn't make sense, logically: "The hex string is in little endian byte order (since it represents a 2-byte integer or short)"... What I was trying to say is that the integer that this hex string represents is multi-byte, so the order of the hex bytes **

Re: UNHEXING to integer (as opposed to a string)...

2010-02-28 Thread mysql.l...@juun.com
Oops: This little bit doesn't make sense, logically: "The hex string is in little endian byte order (since it represents a 2-byte integer or short)"... What I was trying to say is that the integer that this hex string represents is multi-byte, so the order of the hex bytes **

UNHEXING to integer (as opposed to a string)...

2010-02-28 Thread mysql.l...@juun.com
I've tried several ways to get my hex-encoded string representation of an integer to convert back to an integer, but none of them work (the input string '1a4b' should evaluate to 6731): (Note that this is not an endianness problem. The hex string is in little endian byte

Re: Are dates stored as String? Or Integer?

2009-01-29 Thread Martijn Tonies
Are date columns stored as String or Integer in a MyISAM table? I am trying to squeeze more speed from my application and a date column is used in most of the indexes for my tables. I'm wondering if changing the Date data type to an Integer is going to speed the queries up. I&#x

Re: Are dates stored as String? Or Integer?

2009-01-28 Thread Paul DuBois
On Jan 27, 2009, at 11:31 PM, mos wrote: Are date columns stored as String or Integer in a MyISAM table? I am trying to squeeze more speed from my application and a date column is used in most of the indexes for my tables. I'm wondering if changing the Date data type to an Integ

Re: Are dates stored as String? Or Integer?

2009-01-27 Thread Michael Dykman
For the DATE type, the comparisons are performed aginst raw binary data as an integer would be. I read your first post too hastily and thought you were proposigng to store dates as string. (don't laugh, I have seen this done by people who should know better). I don't think you ar

Re: Are dates stored as String? Or Integer?

2009-01-27 Thread mos
, So if I understand it correctly, if I switch from Date to Int(8) 4 bytes to represent 20080125, then the queries should be faster? Because it doesn't have to encode the date to a 3 byte integer or decode it when retrieving the date value? Mike - michael dykman On Wed, Jan 28, 20

Re: Are dates stored as String? Or Integer?

2009-01-27 Thread Michael Dykman
: > Are date columns stored as String or Integer in a MyISAM table? > > I am trying to squeeze more speed from my application and a date column is > used in most of the indexes for my tables. I'm wondering if changing the > Date data type to an Integer is going to speed the q

Are dates stored as String? Or Integer?

2009-01-27 Thread mos
Are date columns stored as String or Integer in a MyISAM table? I am trying to squeeze more speed from my application and a date column is used in most of the indexes for my tables. I'm wondering if changing the Date data type to an Integer is going to speed the queries up. I'm usi

Re: integer

2008-05-24 Thread B J Ambrose
--- On Thu, 5/22/08, Norbert Tretkowski <[EMAIL PROTECTED]> wrote: From: Norbert Tretkowski <[EMAIL PROTECTED]> Subject: Re: integer To: mysql@lists.mysql.com Date: Thursday, May 22, 2008, 3:34 PM Am 22.05.2008, 14:04 +0530 schrieb Krishna Chandra Prajapati: I would to kn

Re: integer

2008-05-24 Thread Moon's Father
lt;[EMAIL PROTECTED]> wrote: > > > From: Norbert Tretkowski <[EMAIL PROTECTED]> > > Subject: Re: integer > > To: mysql@lists.mysql.com > > Date: Thursday, May 22, 2008, 3:34 PM > > Am 22.05.2008, 14:04 +0530 schrieb Krishna Chandra > > Prajapati: > >

Re: integer

2008-05-22 Thread Krishna Chandra Prajapati
; - Original Message > > From: Krishna Chandra Prajapati <[EMAIL PROTECTED]> > > To: MYSQL General List > > Sent: Thursday, 22 May, 2008 9:34:55 AM > > Subject: integer > > > > Hi, > > > > I would to know the difference between the t

Re: integer

2008-05-22 Thread Saravanan
what kind of datatype it is int(50) parent_id| int(50) is that big int? Saravanan --- On Thu, 5/22/08, Norbert Tretkowski <[EMAIL PROTECTED]> wrote: > From: Norbert Tretkowski <[EMAIL PROTECTED]> > Subject: Re: integer > To: mysql@lists.mysql.com > Date: T

Re: integer

2008-05-22 Thread Norbert Tretkowski
Am 22.05.2008, 14:04 +0530 schrieb Krishna Chandra Prajapati: > I would to know the difference between the two > > int(10) and int (Used in create table ) MySQL has an excellent documentation, which of course also answers your question: http://dev.mysql.com/doc/refman/5.1/en/numeric-types.html

Re: integer

2008-05-22 Thread Moon's Father
> int59 > > - Original Message > > From: Krishna Chandra Prajapati <[EMAIL PROTECTED]> > > To: MYSQL General List > > Sent: Thursday, 22 May, 2008 9:34:55 AM > > Subject: integer > > > > Hi, > > > > I would to know the diff

Re: integer

2008-05-22 Thread Glyn Astill
int(10) will pad with zeros on return, i.e. if value = 59 int(10) 59 int59 - Original Message > From: Krishna Chandra Prajapati <[EMAIL PROTECTED]> > To: MYSQL General List > Sent: Thursday, 22 May, 2008 9:34:55 AM > Subject: integer >

integer

2008-05-22 Thread Krishna Chandra Prajapati
Hi, I would to know the difference between the two int(10) and int (Used in create table ) Which one is better and why. Regards, -- Krishna Chandra Prajapati MySQL DBA,

Re: Incrementing a "Private" Integer Space

2007-11-25 Thread David T. Ashley
Hi Martin, The easiest way to restore context in this conversation is to go to the MySQL home page (www.mysql.com), then go to "Community", then "Lists", then to look at the archives of the main MySQL mailing list (this one). I believe at this point that Chris and Stut answered my question decisi

RE: Incrementing a "Private" Integer Space

2007-11-25 Thread Martin Gainty
Dave is trying to establish an algorithm which would fit your requirement I can see column q is auto-increment which makes sense as you retain the capability to generate a unique row but jumping into the middle of a conversation without knowing the prior discussionWhat is/was/will be the purpos

Re: Incrementing a "Private" Integer Space

2007-11-25 Thread Chris W
David T. Ashley wrote: Hi Chris, OK, I will try that. Thanks for the help. My assumption in reading your original post was that you didn't understand what I wanted to do (but you did). In order for me to use the solution you have proposed, in addition to working, this behavior would have to

Re: Incrementing a "Private" Integer Space

2007-11-25 Thread David T. Ashley
On 11/25/07, Chris W <[EMAIL PROTECTED]> wrote: > > Stut wrote: > > > > insert into test1 set p = 2, q = (select max(q) + 1 from test1 as tmp > > where p = 2) > > > > Probably not very efficient, but it works. > > > > -Stut > > > Auto increment is much easier to do. If your primary key is made up

Re: Incrementing a "Private" Integer Space

2007-11-25 Thread Chris W
Stut wrote: insert into test1 set p = 2, q = (select max(q) + 1 from test1 as tmp where p = 2) Probably not very efficient, but it works. -Stut Auto increment is much easier to do. If your primary key is made up of two fields and one of them is Auto Increment, then it will have the desir

Re: Incrementing a "Private" Integer Space

2007-11-25 Thread Stut
David T. Ashley wrote: On 11/25/07, Stut <[EMAIL PROTECTED]> wrote: David T. Ashley wrote: I have a table with two integer fields (call them p and q). When I insert a record with a known p, I want to choose q to be one larger than the largest q with that p. What is the best an

Re: Incrementing a "Private" Integer Space

2007-11-25 Thread David T. Ashley
On 11/25/07, Stut <[EMAIL PROTECTED]> wrote: > David T. Ashley wrote: > > I have a table with two integer fields (call them p and q). > > > > When I insert a record with a known p, I want to choose q to be one > larger > > than the largest q with that

Re: Incrementing a "Private" Integer Space

2007-11-25 Thread Stut
David T. Ashley wrote: I have a table with two integer fields (call them p and q). When I insert a record with a known p, I want to choose q to be one larger than the largest q with that p. What is the best and most efficient way to do this? For example, let's say the table contains

Re: Incrementing a "Private" Integer Space

2007-11-24 Thread Chris W
David T. Ashley wrote: I have a table with two integer fields (call them p and q). When I insert a record with a known p, I want to choose q to be one larger than the largest q with that p. What is the best and most efficient way to do this? For example, let's say the table contains

Incrementing a "Private" Integer Space

2007-11-24 Thread David T. Ashley
I have a table with two integer fields (call them p and q). When I insert a record with a known p, I want to choose q to be one larger than the largest q with that p. What is the best and most efficient way to do this? For example, let's say the table contains (p,q): 1,1 1,2 1,3 2,1 2,

Changing Big Big integer Value

2007-08-10 Thread Stephen Sunderlin
o the Foreign Key joining the other tables was changed to an integer with 27 digits. Then during the transfer from ACCESS to mySQL this Primary Key was inserted into a VARCHAR field. I would like to change the field type to INT so I can add auto_increment however the number is too large for even B

Re: How to order a string as integer

2007-06-28 Thread David T. Ashley
On 6/28/07, Magnus Borg <[EMAIL PROTECTED]> wrote: Got strings in the format "integer+(char)^0..1", ex 3456, 2323, 2324A, 2324B, ... I want to order them as they where integers, like: order by cast(STING as unsigned) desc But when using that query resulting in err

How to order a string as integer

2007-06-28 Thread Magnus Borg
Hello list Got strings in the format "integer+(char)^0..1", ex 3456, 2323, 2324A, 2324B, ... I want to order them as they where integers, like: order by cast(STING as unsigned) desc But when using that query resulting in error 1292. And the result are not correct. How ca

RE: return integer for positive values

2007-04-05 Thread Jerry Schwartz
d 195 Farmington Ave. Farmington, CT 06032 860.674.8796 / FAX: 860.674.8341 > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Thursday, April 05, 2007 3:40 PM > To: Jerry Schwartz; mysql@lists.mysql.com > Subject: RE: return integer for positi

Re: return integer for positive values

2007-04-05 Thread ddevaudreuil
lly wanting is a list of all the pollutants with a > integer field, zero for pollutant not here, 1 for pollutant here. > > So that instead of the list I get now: > benzaldehyde > freon > formaldehyde > > I would get: > > lead 0 > acetone 0 > benzaldehyde 1 &g

RE: return integer for positive values

2007-04-05 Thread jabbott
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > Sent: Thursday, April 05, 2007 2:47 PM > > To: mysql@lists.mysql.com > > Subject: return integer for positive values > > > > > > I have a table with a list of pollutants. I have a table of > > locations, site

RE: return integer for positive values

2007-04-05 Thread Jerry Schwartz
IL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Thursday, April 05, 2007 2:47 PM > To: mysql@lists.mysql.com > Subject: return integer for positive values > > > I have a table with a list of pollutants. I have a table of > locations, site names, counties, etc. I can join the th

return integer for positive values

2007-04-05 Thread jabbott
I have a table with a list of pollutants. I have a table of locations, site names, counties, etc. I can join the these tables together and get a list of of all the pollutants at a site. But, what I am really wanting is a list of all the pollutants with a integer field, zero for pollutant

Re: Converting string hex column to integer

2006-06-28 Thread Dušan Pavlica
Wolfram Kraus napsal(a): On 28.06.2006 13:54, Dušan Pavlica wrote: Hello, I have column of type char(2) containing hex numbers (e.g. "0A", "FF", ...) and I cannot find correct function which could convert those hex numbers to integers so I can perform futher calculations. I experimented with

Re: Converting string hex column to integer

2006-06-28 Thread Wolfram Kraus
On 28.06.2006 13:54, Dušan Pavlica wrote: > Hello, > I have column of type char(2) containing hex numbers (e.g. "0A", "FF", > ...) and I cannot find correct function which could convert those hex > numbers to integers so I can perform futher calculations. I experimented > with HEX(), CAST(), CONVER

Converting string hex column to integer

2006-06-28 Thread Dušan Pavlica
Hello, I have column of type char(2) containing hex numbers (e.g. "0A", "FF", ...) and I cannot find correct function which could convert those hex numbers to integers so I can perform futher calculations. I experimented with HEX(), CAST(), CONVERT() but I wasn't succesfull. Thanks in advance

RE: How can I isolate the integer part of a varchar field and use it in an ORDER BY?

2006-01-24 Thread Nicolas Verhaeghe
You're very helpful, thanks. Problem already taken care of but thanks for the lesson. -Original Message- From: Michael Stassen [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 24, 2006 10:55 PM To: Nicolas Verhaeghe Cc: mysql@lists.mysql.com Subject: Re: How can I isolate the in

Re: How can I isolate the integer part of a varchar field and use it in an ORDER BY?

2006-01-24 Thread Michael Stassen
Nicolas Verhaeghe wrote: Because I am currently stuck with 3.23 I have just decided to create a "displacement" field to isolate the number. That's the right way to go, regardless of version. Besides, some of these bikes escape from the rules, for instance instead of 600 for 600cc, you only ha

Re: How can I isolate the integer part of a varchar field and use it in an ORDER BY?

2006-01-24 Thread Michael Stassen
Nicolas Verhaeghe wrote: Thanks, but unfortunately the replace function does not want to work on a regexp in version 3.23... or 4.0, or 4.1, or ... I guess I'll have to create a "displacement" field and populate it from the admin tool. Well, that's the right way to go. You're seeing the pr

RE: How can I isolate the integer part of a varchar field and use it in an ORDER BY?

2006-01-24 Thread Nicolas Verhaeghe
l the displacement fields will work fine. -Original Message- From: Michael Stassen [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 24, 2006 10:11 PM To: George Law Cc: Nicolas Verhaeghe; mysql@lists.mysql.com Subject: Re: How can I isolate the integer part of a varchar field and use i

Re: How can I isolate the integer part of a varchar field and use it in an ORDER BY?

2006-01-24 Thread Michael Stassen
George Law wrote: Nicolas, Not sure when the "replace" function was introduced into mysql, but I think it might do... REPLACE() exists in 3.23. Use "replace" in your order by, replacing a-z with null chars, leaving just your numeric digits, then order by Easier said than done. select *

RE: How can I isolate the integer part of a varchar field and use it in an ORDER BY?

2006-01-24 Thread George Law
the numeric part), and sort based on these 2 column. -- George -Original Message- From: Nicolas Verhaeghe [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 24, 2006 11:09 AM To: mysql@lists.mysql.com Subject: RE: How can I isolate the integer part of a varchar field and use it in an

RE: How can I isolate the integer part of a varchar field and use it in an ORDER BY?

2006-01-24 Thread Nicolas Verhaeghe
-- From: George Law [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 24, 2006 8:14 AM To: Nicolas Verhaeghe; mysql@lists.mysql.com Subject: RE: How can I isolate the integer part of a varchar field and use it in an ORDER BY? Nicolas, Not sure when the "replace" function was introduce

RE: How can I isolate the integer part of a varchar field and use it in an ORDER BY?

2006-01-24 Thread George Law
ilto:[EMAIL PROTECTED] Sent: Tuesday, January 24, 2006 9:13 AM To: 'Gleb Paharenko'; mysql@lists.mysql.com Subject: RE: How can I isolate the integer part of a varchar field and use it in an ORDER BY? Oh yeah, I forgot to tell... I still use 3.23. Cannot upgrade for the moment. So no SP..

RE: How can I isolate the integer part of a varchar field and use it in an ORDER BY?

2006-01-24 Thread Nicolas Verhaeghe
Subject: Re: How can I isolate the integer part of a varchar field and use it in an ORDER BY? Hello. The "brute force" way is to create and UDF or store function which can extract the numeric part from the string and ORDER BY the results of this function. See: http://dev.mysql.com/doc/ref

Re: How can I isolate the integer part of a varchar field and use it in an ORDER BY?

2006-01-24 Thread Gleb Paharenko
r those who are into that type of > vehicles). > > How can I achieve this goal without creating a specific field in the > database? > > I tried converting the field to integer, which is something that I can > do with MS SQL (converting a varchar field to integer "extracts

How can I isolate the integer part of a varchar field and use it in an ORDER BY?

2006-01-23 Thread Nicolas Verhaeghe
e are Yamahas and KTMs, for those who are into that type of vehicles). How can I achieve this goal without creating a specific field in the database? I tried converting the field to integer, which is something that I can do with MS SQL (converting a varchar field to integer "extracts" t

convert varchar/char to integer

2006-01-20 Thread morten bjoernsvik
Hi Gents Is it possible to sort char/varchars that only contains integers as integers and not as characters. I can't use integer because the standard says it may contain characters aswell. Currently I do this outside mysql in a perl-procedure. Whatever I try I get this

Re: convert varchar/char to integer

2006-01-20 Thread morten bjoernsvik
morten bjoernsvik <[EMAIL PROTECTED]> skrev: Hi Gents Is it possible to sort char/varchars that only contains integers as integers and not as characters. I can't use integer because the standard says it may contain characters aswell. Currently I do this outside mysql in a per

Re: Strange behavior with integer unsigned type...

2005-12-30 Thread Stephen Cook
es me 4294967295 is integer(10) unsigned... maybe it would be more logical the expression to evaluate as 0, insted 2^32 .. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: Strange behavior with integer unsigned type...

2005-12-30 Thread Gleb Paharenko
Hello. That seems like a bug: http://bugs.mysql.com/bug.php?id=14543 Marko Domanovic wrote: > mysql 5.0.15-standard > UPDATE SET = -1 > when the is 0 gives me 4294967295 > is integer(10) unsigned... > > maybe it would be more logical the expression to evalu

Re: Strange behavior with integer unsigned type...

2005-12-24 Thread Marko Domanovic
mysql 5.0.15-standard UPDATE SET = -1 when the is 0 gives me 4294967295 is integer(10) unsigned... maybe it would be more logical the expression to evaluate as 0, insted 2^32 .. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http

Re: Strange behavior with integer unsigned type...

2005-12-23 Thread James Harvard
AS UNSIGNED) >-> 18446744073709551615 > >Marko Domanovic wrote: >> I noticed rather interesting thing... If you deduct 1 from the 0 which is >> stored in integer unsigned field, you get 2^32, not 0. I think that's how >> things are not working with ver

Re: Strange behavior with integer unsigned type...

2005-12-23 Thread Gleb Paharenko
rs. In the manual we have: mysql> SELECT CAST(1-2 AS UNSIGNED) -> 18446744073709551615 Marko Domanovic wrote: > I noticed rather interesting thing... If you deduct 1 from the 0 which is > stored in integer unsigned field, you get 2^32, not 0. I think that's how &g

Strange behavior with integer unsigned type...

2005-12-23 Thread Marko Domanovic
I noticed rather interesting thing... If you deduct 1 from the 0 which is stored in integer unsigned field, you get 2^32, not 0. I think that's how things are not working with version 4, and want to ask is this behavior bug or feature in mysql version 5, and is it customizable? Gree

Re: question about field length for integer

2005-06-28 Thread Michael Stassen
[EMAIL PROTECTED] wrote: Eko Budiharto <[EMAIL PROTECTED]> wrote on 06/26/2005 11:02:30 AM: Hi, is there anyway that I can have more than 20 digits for integer (bigInt)? If not, what I can use for database index? BIGINT UNSIGNED can range from 0 to 18446744073709551615

Re: question about field length for integer

2005-06-27 Thread SGreen
ate all of your key values so that they look like numbers smaller than > >18446744073709551615, it can't fit into a BIGINT UNSIGNED column. > > What I have in here, I have a table that use integer(BIGINT) for > index/ID and auto increment. > CREATE TABLE server ( > ID bigint(20) auto_incre

Re: question about field length for integer

2005-06-27 Thread Alec . Cawley
[EMAIL PROTECTED] wrote on 27/06/2005 16:33:44: > Are you actually saying that you have a database with more than 1.8e+19 > records in it? I don't think you do. If you were to add records at the rate of a million a second, which is, I think, beyond the capabilities of any foreseeable future h

RE: question about field length for integer

2005-06-27 Thread Gordon Bruce
. This change to DECIMAL storage format changes the storage requirements as well. Storage for the integer and fractional parts of each value are determined separately. Each multiple of nine digits requires four bytes, and the "leftover" digits require some fraction of four bytes. For

Re: question about field length for integer

2005-06-27 Thread SGreen
Eko Budiharto <[EMAIL PROTECTED]> wrote on 06/26/2005 11:02:30 AM: > Hi, > is there anyway that I can have more than 20 digits for integer > (bigInt)? If not, what I can use for database index? BIGINT UNSIGNED can range from 0 to 18446744073709551615 (http://dev.mysql.com/doc/m

question about field length for integer

2005-06-26 Thread Eko Budiharto
Hi, is there anyway that I can have more than 20 digits for integer (bigInt)? If not, what I can use for database index? - Yahoo! Sports Rekindle the Rivalries. Sign up for Fantasy Football

Re: load data infile. Empty input field -> integer. How make NULL ?

2005-05-29 Thread mfatene
| | a| NULL | c| +--+--+--+ 2 rows in set (0.00 sec) Mathias Selon Pete Lancashire <[EMAIL PROTECTED]>: > I've been surfing the list / google but can't find what to do > > I have a tab sep file, where there are empty fields i.e. > > >

load data infile. Empty input field -> integer. How make NULL ?

2005-05-29 Thread Pete Lancashire
I've been surfing the list / google but can't find what to do I have a tab sep file, where there are empty fields i.e. the fields are associated with a mysql table integer type. how do I get the empty fields to become NULL instead of 0 (zero) with a warning ? Thanks, -pete

Re: Increase Integer Key Length

2005-05-13 Thread Michael Stassen
Terence wrote: Hi List, When using EXPLAIN, the key length on an integer column is stated as 4. However the column is running into 7 digits, and that's affecting our performance. Anyway to increase the key length? From the manual I have found that it can be done for varchar cols. Thank

Increase Integer Key Length

2005-05-13 Thread Terence
Hi List, When using EXPLAIN, the key length on an integer column is stated as 4. However the column is running into 7 digits, and that's affecting our performance. Anyway to increase the key length? From the manual I have found that it can be done for varchar cols. Thanks for any help. --

Re: Converting Integer values to date type

2005-03-21 Thread Michael Stassen
now that I have what I want, but if someone can pick out my error, would be greatly apreciated. On Fri, 18 Mar 2005 13:31:14 -0600, Dan Nelson <[EMAIL PROTECTED]> wrote: In the last episode (Mar 18), Mahmoud Badreddine said: Hello, I have a table with separate integer values for the day, m

Re: Converting Integer values to date type

2005-03-18 Thread Mahmoud Badreddine
n <[EMAIL PROTECTED]> wrote: > In the last episode (Mar 18), Mahmoud Badreddine said: > > Hello, > > I have a table with separate integer values for the day, month and year. > > I would like to group them all under one field of type date. > > I tried a few com

Re: Converting Integer values to date type

2005-03-18 Thread Dan Nelson
In the last episode (Mar 18), Mahmoud Badreddine said: > Hello, > I have a table with separate integer values for the day, month and year. > I would like to group them all under one field of type date. > I tried a few commands but I haven't captured the right syntax yet. > >

Converting Integer values to date type

2005-03-18 Thread Mahmoud Badreddine
Hello, I have a table with separate integer values for the day, month and year. I would like to group them all under one field of type date. I tried a few commands but I haven't captured the right syntax yet. so if the field names are dayVal,monthVal and YearVal in talbeDummy I am doin

Re: faster integer compare?

2004-10-23 Thread mos
HERE profile_owner="3432"; I think it depends on which version of MySQL you're using. Since "3432" is a string, I suspect MySQL 3.x may have to convert the column profile_owner values into a string so it can't use the index and it is forced to read all the rows in

faster integer compare?

2004-10-23 Thread Eric Persson
Hi, I'm using mysql with php and have recently made some effort optimizing all queries on a project and I noticed something strange and wanted to check if this is correct. Lets say I have a table looking like this: CREATE TABLE `profile_visitors` ( `profile_owner` int(10) unsigned NOT NULL def

Re: Asterisks in Integer Columns

2004-06-07 Thread Michael Stassen
nswer those questions. The population column is an integer column which only contains integers. If you don't want to show the notes, simply select and display the population values. If you do want to display the notes, then you select them as well. Once selected, you can display them

Re: Asterisks in Integer Columns

2004-06-06 Thread Daniel Clark
berals - area, >>popoulation, etc. - and I want to include asterisks >>and footnotes, as in below: >> >>200 >>4200 >>258* >>234 >> >>24 >>2581 >>2400 >> >>What are some good strategies for doing this? You >>really aren&

Asterisks in Integer Columns

2004-06-06 Thread David Blomstrom
Suppose I have several columns of numberals - area, popoulation, etc. - and I want to include asterisks and footnotes, as in below: 200 4200 258* 234 24 2581 2400 What are some good strategies for doing this? You really aren't supposed to include asterisks in integer columns, right? It

Re: Storing mysql dates as an integer

2004-01-08 Thread Craig A. Finseth
An unsigned int is probably more appropriate for timestamps than a signed int. Also note that the range for timestamps is 1970 until 2038 (or 2106? for unsigned ints), where DATE and DATETIME have a much greater range. Using a UNIX timestamp for birthdays might not be appropriate.

RE: Storing mysql dates as an integer [SOLVED]

2004-01-08 Thread Dave G
Fred, > An unsigned int is probably more appropriate for timestamps than a > signed int. Thank you, that was the kind of advice I was looking for. And your point about not using UNIX time stamps for birthdays and things that could well be outside their date range is well taken. I'm only u

Re: Storing mysql dates as an integer

2004-01-08 Thread Fred van Engen
'm thinking now is that it might just be easier for me to > store the date as a UNIX timestamp format in MySQL as a simple ten digit > long integer (Unix timestamps are ten digits, aren't they?). That way I > can pass them to and from PHP and do all the work on the PHP side > wit

  1   2   >