Hi Bruce,
bruce wrote:
hi...
a further test...
the following test tbl/information:
dog
name char
statusint
_date timestamp
idint
here's the tricky part. if i want to get the row with the status=3, but only
if there's not a status=4 that has a later date, how
Gabriel PREDA wrote:
So AFAIK this is the purpose of the "length"...in INTEGER columns.
-- -- -- -- -- -- -- -- -- -- -- -- --
Gabriel PREDA
Senior Web Developer
Olaf,
As Gabriel so eloquently demonstrated, the LENGTH parameter only affects
how the numbers are displayed, not how they are st
Ed Reed wrote:
I use On Duplicate Key Update a lot and I usually use it like this,
Insert Into tablename (myID, Qty)
Values (1034,15),
(6,13),
(5001,1),
(145,20) On Duplicate Key Update Qty=Values(Qty);
This works very well but now I'd like to do something a little
different. I'd like to have
Sorry for the premature question. I think I figured it out.
On Duplicate Key Update Qty=Qty+Values(Qty);
I haven't tested it yet but it makes sense that it'll work.
>>> "Ed Reed" <[EMAIL PROTECTED]> 1/5/07 2:40 PM >>>
I use On Duplicate Key Update a lot and I usually use it like this,
Inser
I use On Duplicate Key Update a lot and I usually use it like this,
Insert Into tablename (myID, Qty)
Values (1034,15),
(6,13),
(5001,1),
(145,20) On Duplicate Key Update Qty=Values(Qty);
This works very well but now I'd like to do something a little
different. I'd like to have a query like this
Hi Olaf,
For soon to be a decade I'm fighting with this question... !!!
It's not a silly one... it's quite a tricky one...
As many have noticed all INTEGER types (SMALLINT, MEDIUMINT, INT,
BIGINT) have a "LENGTH"... by all means I can assure you that it has
nothing to do with the maximum number
Complementary to what Donna said,
You can issue a
SHOW WARNINGS
sql after some of these queries... the "cutt-off" will be listed there !
You will get a mysql_result in the form:
Level - Code - Message
Warning - 1265 - Data truncated for column 'column_name' at row X.
Gabriel PREDA
On 1/5/07,
The "length" of the numeric type defines the way it will be displayed. The
storage requirement is defined by the numeric data type (tinyint, etc.). I
don't think there's any way to have MySQL limit input data to the "length"
you use.
Regards,
Jerry Schwartz
Global Information Incorporated
195 Far
For limiting possible values to 0, 1, 2, 3, 4, 5 you could use an ENUM,
although that is not advised because you're using numeric indices to refer
to numeric values and that can be confusing.
Regards,
Jerry Schwartz
Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032
860.674
Sorry, wrong example
For instance, it makes no difference regarding the values I can enter if I
declare a field as int or int(3)
On 1/5/07 1:52 PM, "Olaf Stein" <[EMAIL PROTECTED]> wrote:
> Thanks
> That works nicely.
>
> Why does that not have any effect with numeric values.
> E.g. I can inse
Thanks
That works nicely.
Why does that not have any effect with numeric values.
E.g. I can insert the same max numbers in a tinyint column then in a
tinyint(1) column,
For example, how do I create a column that only allows 1 numeric value from
0 to 5?
Thanks
Olaf
On 1/5/07 12:52 PM, "[EMAIL
You need to set the sql_mode to STRICT_TRANS_TABLES or STRICT_ALL_TABLES.
We set this for the server in the my.cnf file. Be careful, though,
because there are some third-party GUI clients that don't read the my.cnf
file and thus don't set the sql_mode to what you expect. In that case,
set it
Hi all
If I insert a value to great for a field (e.g. '123456' into a varchar(5)
field), mysql runs the insert without warning or error and cuts of what
doesn't fit.
How can I tell it to launch an error and abort the insert?
Thanks
Olaf
--
MySQL General Mailing List
For list archives: http://
Thanks Chris,
You're right, I reversed the arguments. However,
SELECT TIME_FORMAT('%f',CURTIME());
gives normal time format like 17:37:47
SELECT TIME_FORMAT('%f',NOW());
gives normal date/time format.
SELECT MICROSECOND(CURTIME());
gives 0.
I need microseconds to get the query runtime.
B
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Actually, I think he was asking if the sized used by the storage engine
would change if you used for example int(2) as apposed to int(10). My guess
is it would not, but that's just a guess.
Aaron Cannon
- --
Skype: cannona
MSN/Windows Messenger: [
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
It is unfortunate that mysql does not offer a binary version with ssl
support for Linux. Does anyone know why? It can't be for export reasons,
as they do offer a windows version with SSL support.
Aaron Cannon
- --
Skype: cannona
MSN/Windows Mess
C.R.Vegelin wrote:
Hi List,
I need the lapse time in microseconds.
I have tried various things, like:
SELECT TIME_FORMAT(CURTIME(), '%f');
SELECT TIME_FORMAT(NOW(), '%f');
Your arguments are reversed. It's:
SELECT TIME_FORMAT('%f',CURTIME());
SELECT TIME_FORMAT('%f',NOW());
SELECT MIC
Guillermo -
You likely want mysqldump -
http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html
Dan
On 1/5/07, Guillermo <[EMAIL PROTECTED]> wrote:
Hello, i have this problem:
I have two databases in diferent servers. I need to copy the contents from some tables in Server1
to Server2, so i tr
Chris White wrote:
Duncan Hutty wrote:
I attempted to build 5.1.14-beta with ssl support and it failed
(output below).
It builds quite happily on this system without the ssl support
parameter to configure. Since it appears to fail in an area (timezone
system) that to me seems rather unrelate
Hello, i have this problem:
I have two databases in diferent servers. I need to copy the contents from
some tables in Server1 to Server2, so i tried using the "select into outfile "
and then " load data ", but the problem is that this commands creates the files
on the server, and i want/need t
Hi all
When i try to run mysqld_safe cmd, it fails saying :
Starting mysqld daemon with databases from /var/lib/mysql
STOPPING server from pid file /var/run/mysqld/mysqld.pid
070105 20:23:40 mysqld ended
Also mysqld.pid does not exist at the given path!
Any Idea what to do??? mysql_install_db
You want to use a LEFT JOIN, which will select all the records from A and link them with records in B if there are any. If there are
no matches in B, the the fields from B will be NULL. You then just check for the NULL value (no match) in a B field and use that as
your filter.
SELECT A.*,B.D FR
Olaf, not a silly question at all. You can indeed save space by using
different forms of integer.
See
http://dev.mysql.com/doc/refman/5.0/en/numeric-type-overview.html
and
http://dev.mysql.com/doc/refman/5.0/en/storage-requirements.html
From that second page:
Storage Requirements for Numeric
Hi All,
I have somewhat of a silly question.
If I define a column as int it needs 4 bytes.
Do I gain anything space wise if I restrict the length to e.g. 10, int(10),
or is this only a logical restriction?
Thanks
Olaf
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/m
Hi List,
I need the lapse time in microseconds.
I have tried various things, like:
SELECT TIME_FORMAT(CURTIME(), '%f');
SELECT TIME_FORMAT(NOW(), '%f');
SELECT MICROSECOND(CURTIME());
but all I get is 0.
What am I doing wrong ?
TIA, Cor
Hi,
Your procedure returned correct numbers.
Does misrepresentation happens for all the runs or adhoc.
Thanks
ViSolve DB Team.
- Original Message -
From: "brian stone" <[EMAIL PROTECTED]>
To:
Sent: Wednesday, January 03, 2007 8:55 AM
Subject: SP not seeing INSERTs within WHILE loop
26 matches
Mail list logo