sed -r "s/ +/\t/g" infile.txt
or
perl -e "s/\s+/\t/g and print $_.\"\n\" while <>" < infile.txt
--
Chris Wagner
CBTS
GE Aircraft Engines
[EMAIL PROTECTED]
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
How do I store multiple languages in the MySQL database. Is there any
configuration in MySql database server to support multilingual data.
Normally if I use UTF-8 character encoding in database, it supports multiple
languages. But it is not happening in MySql.
Thanks
Krish
--
View this messag
You could do something like that by using a derived table (subselect)
to pick the max date for each product sale and then joining that on
the products table again to pick up the amounts.
Note that you must use mysql 5.x to be able to use subselects.
Also this will return multiple rows for
This should be easy but I can't find a way of doing it in 1 step.
I have a Trans table like:
Product_Code: X(10)
Date_Sold: Date
Price_Sold: Float
Now there will be 1 row for each Product_Code, Date combination. So over
the past year a product_code could have over 300 rows, one row for each da
In the last episode (Sep 28), Henda Carvalho said:
> One more question,
>
> What kind of tables does mysql create by default? innodb or myisam?
The default is myisam.
--
Dan Nelson
[EMAIL PROTECTED]
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
You can create FULLTEXT indexes on text fields - but that may not be
the best solution for your situation since you are querying for an
exact match.
In MySQL 5.0.3 and later, you can create VARCHAR columns of up to
65,535 character lengths:
http://dev.mysql.com/doc/refman/5.0/en/char.html
I seem
I think you have to specify a key length when you use an index on a
text field...
mysql> alter table t2 add index i2(t1(3));
That would create an index (called "i2") on the first 3 characters of
field "t1" of table "t2".
I think that's right?
Douglas Sims
[EMAIL PROTECTED]
On Sep 27, 2
Hi,
since urls can be longer than 255 chars, I made the url field a TEXT field.
The problem is, I can't make an index on it, so doing 'WHERE
url='xxx'' becomes a very sloow query.
Any ideas for solutions? Am I mistaken in the idea that I can't make
an index on a TEXT field?
Thanks!
Peter
--
Fi
This is a situation where u should use mysqlhotcopy. That gives u a
snapshot of the current table and lets u work on it "offline" while the
real table is available.
hotcopy table A to B
blank table A to allow inserts
work on table B
merge A into B
delete A
rename B to A
--
Chris Wagner
CBTS
G
Brian Dunning wrote:
Before I do this, I just wanted to check with you all to see if this is
the correct command:
/etc/rc.d/init.d/mysqld restart --log-slow-queries
If so, where exactly will I find the slow query log?
Will the slow query log be turned off by default next time I restart it?
T
One more question,
What kind of tables does mysql create by default? innodb or myisam?
Best regards
Henda
On 9/27/06, Dan Nelson <[EMAIL PROTECTED]> wrote:
In the last episode (Sep 27), Henda Carvalho said:
> The links that you gave me doesn't say what is suposed to happen if 2
> different us
In the last episode (Sep 27), Henda Carvalho said:
> The links that you gave me doesn't say what is suposed to happen if 2
> different users are trying to make an insert (using the insert
> statement) to the same table.
>
> Will the transaction abort for one of the users?
No; they will both proce
Hi there,
The links that you gave me doesn't say what is suposed to happen if 2
different users are trying to make
an insert (using the insert statement) to the same table.
Will the transaction abort for one of the users?
Best regards,
Henda
On 9/27/06, Dan Nelson <[EMAIL PROTECTED]> wrote:
Before I do this, I just wanted to check with you all to see if this
is the correct command:
/etc/rc.d/init.d/mysqld restart --log-slow-queries
If so, where exactly will I find the slow query log?
Will the slow query log be turned off by default next time I restart it?
--
MySQL General Mailin
In the last episode (Sep 27), Henda Carvalho said:
> Can somebody please tell me what is the behaviour of mysql when 2
> different users are trying to make an insert to the same table.
http://dev.mysql.com/doc/refman/5.0/en/table-locking.html
http://dev.mysql.com/doc/refman/5.0/en/concurrent-inser
Hello,
Can somebody please tell me what is the behaviour of mysql when 2 different
users are trying to make an insert to the same table.
Best regards,
Henda Mendes de Carvalho
Hello,
Can somebody please tell me what is the behaviour of mysql when 2 different
users are trying to make an insert to the same table.
Best regards,
Henda Mendes de Carvalho
The table switch-a-roo scheme would accomplish this - it lets you copy
the data into the duplicate table, and can run as long as needed since
it won't be tying up a table that your users are trying to access.
Then once the move is completed, the table rename operation should
complete very quickly,
Thanks Dan, I believe that's exactly what I was looking for. Thanks
for not saying "RTFM" even though it clearly applies. :)
On Sep 27, 2006, at 12:57 PM, Dan Julson wrote:
Brian,
Look at the ON DUPLICATE KEY UPDATE syntax within the INSERT SYNTAX
of the
Docs. That should give you wha
This is the kind of thing I've been trying, but anything like this
locks up the machine, all the users get errors, and I have to restart
mysql. This is why I'm looking for something like a "LOW PRIORITY"
solution, hoping that it won't try to use resources until they're
available.
On Sep
Brian,
Look at the ON DUPLICATE KEY UPDATE syntax within the INSERT SYNTAX of the
Docs. That should give you what you want.
-Dan
I have a need to insert a record only when the combination of 3
fields is unique. I do this by having an index with all 3 fields, and
doing an INSERT IGNORE. This w
I have a need to insert a record only when the combination of 3
fields is unique. I do this by having an index with all 3 fields, and
doing an INSERT IGNORE. This works fine.
Here's the element I can't figure out how to add: When there is a pre-
existing record, I want to update two of its c
Brian, I'm not sure there's a quick way to copy 14 million records, no
matter how you slice it. Disabling the indexes on the destination
table might help - but then you've got to devote some time to when you
re-enable them.
You might try this workaround, where you're copying into a duplicate
of
I'm guessing what's happening is that your "import" is locking the table, putting everything else on hold. People keep connecting,
getting put on hold until you run out of connections. It's not that you machine is "so busy", it just can't do two things at once.
One of the limitations of MyISAM ta
Harini, can you post the output you get from the EXPLAIN command?
That is, type "EXPLAIN " and then the query below, and MySQL will show
you an execution plan for the query that could help identify why it's
taking so long.
Dan
On 9/27/06, Harini Raghavan <[EMAIL PROTECTED]> wrote:
Hi All,
I
I have a very busy 14,000,000 record table. I made a new version of
the table, that's more efficient, and now I just need to copy over
the data. Just about anything I try swamps the machine and locks up
MySQL with "too many connections" because it's so damn busy. Can
anyone suggest the most
Hi All,
I am using MyISAM storage engine for 2 of the tables in my application
so as to use the full text search features. When I join any one of the
MyISAM table with other INNODB table, the query is very fast. But, if I
do inner join with both theMyISAM table, then the query takes 5 mins to
Hi.
Hope this is the correct list.
I'm strugling with a right and left join query:
SELECT category.name AS cname, service.name AS tname, service.id AS sid
FROM provider
LEFT JOIN providerservice ON provider.id = providerservice.provider_id
RIGHT JOIN service ON providerservice.service_id = serv
First off, I apologize for the fact that I'm not more versed in the inner
workings of GCC and linking libraries and etc, I'm a web developer and I'm
just using C to try to cut down on some speed problems.
This is my little test program:
#include
#include
#include
#include "mysql.h"
MYSQL mysq
Hi
Can mysql's stored procedures do regex function
--
Gregory Machin
[EMAIL PROTECTED]
www.linuxpro.co.za
For us the querying of trees is more important than the speed of writing them.
So each time we add a child or change a parent or whatever, we trigger a stored
procedure that updates a paths table. Then our query for children is pretty
simple:
SELECT Node.*
FROM Node
JOIN Paths
André
With an edge list, the solution entails recursion, so you need either
an sproc or application proc. With a nested sets model, the count is
dead simple. If the id of the target row is N, and the left & right
node columns are named leftedge and rightedge, the query is
SELECT COUNT(t2.id)
I've found this website to be extremely helpful:
http://www.artfulsoftware.com/mysqlbook/sampler/mysqled1ch20.html
Donna DeVaudreuil
André Hänsel <[EMAIL PROTECTED]>
09/27/2006 10:55 AM
To
<[EMAIL PROTECTED]>
cc
Subject
AW: Count of children
I will use any model that is suitable. ;)
By default it doesn't, but you can change that behaviour. Quoting
from this page http://dev.mysql.com/doc/refman/5.0/en/stored-
procedures.html :
Recursive stored procedures are disabled by default, but can be
enabled on the server by setting the max_sp_recursion_depth server
system var
I will use any model that is suitable. ;)
I am somewhat familiar with both tree models but I can't come up with a
method to get the count of all sub- and sub-sub-nodes in either of them.
> -Ursprüngliche Nachricht-
> Von: Peter Brawley [mailto:[EMAIL PROTECTED]
> Gesendet: Mittwoch, 27.
André,
I want the count of all sub-entries for a specific entry.
Depends on the model you are using--edge list or nested sets?
PB
-
André Hänsel wrote:
I have a table with id and parent_id.
I want the count of all sub-entries for a specific entry.
I found several documents about worki
You must do that by a some language script, unfortunatly mysql is no
recursive.
""André Hänsel"" <[EMAIL PROTECTED]> escreveu na mensagem
news:[EMAIL PROTECTED]
Sorry, my english sentence was imprecise. :) I want the count of all
sub-entries AND THEIR sub-sub-entries.
Example:
A
/ \
André
> Sorry, my english sentence was imprecise. :) I want the count of all
> sub-entries AND THEIR sub-sub-entries.
Example:
A
/ \
B C
/ \
D E
\
F
So I want to know that C has 3 sub-nodes.
Aha! I thought it seemed like an easy question ;-)
As far as i know, the onl
Sorry, my english sentence was imprecise. :) I want the count of all
sub-entries AND THEIR sub-sub-entries.
Example:
A
/ \
B C
/ \
D E
\
F
So I want to know that C has 3 sub-nodes.
> -Ursprüngliche Nachricht-
> Von: Rob Desbois [mailto:[EMAIL PROTECTED]
André,
Your sentence 'I want the count of all sub-entries for a specific entry'
converts straight into SQL:
'I want'
SELECT
the count of all entries
COUNT(*) FROM myTable
with a specific parent
WHERE parent_id = 5
You've missed one of the major benefits of SQL - it's designed to rea
You can use it:
SELECT parent_id, count( * )
FROM table
WHERE parent_id =1
GROUP BY parent_id
It´ll works fine.
""André Hänsel"" <[EMAIL PROTECTED]> escreveu na mensagem
news:[EMAIL PROTECTED]
I have a table with id and parent_id.
I want the count of all sub-entries for a specific entry.
I
Hi Arjun,
Check out the MySQL Migration Toolkit and some other tools available at
http://www.mysql.com/products/tools/migration-toolkit/ and
http://dev.mysql.com/downloads/gui-tools/5.0.html. Do a test migration
and some testing on the migrated dataset, and you can then probably set
up a plan for
I'm used to hammering all kinds of data into MySQL. Often I do it with a PHP
(or Perl) script that handles this kind of thing well. However, often my
data originates on a PC (don't ask), so I run it through MS Excel. Excel
(and OpenOffice, I presume) has good tools for parsing text files, and can
t
Daniel, is it that the columns in the file are separated by a variable
number of spaces? Or is it that the columns are fixed-width,
therefore the number of spaces varies with length of data? If the
file is fixed-width, the SQL below ought to work pretty well.
Either way, your situation is not t
I have a table with id and parent_id.
I want the count of all sub-entries for a specific entry.
I found several documents about working with graphs/trees in MySQL but I
could not find a solution for my problem.
I can imagine two possibilities, but one is memory intensive and the other
one creates
My application contains a table `event` which is essentially a historical log.
Currently it contains a UNIQUE KEY on three fields - the location which
generated the event `location_id`, the timestamp the event was generated
`timestamp`, and the type of event `type`.
I have discovered that this
> >Did you try using a space (' ') as the separator? Did you get an error?
And at 7:41 + 27/9/06, [EMAIL PROTECTED] wrote:
>Yes, I did.
...
>So, I need to specify somehow that the fields are delimited by any
>number of spaces...
One answer of course is grep. However, as far as I can determ
Hello MySQL Fans
First of all, this is not about decision-trees and datamining.
And it is not even MySQL-specific.
I would like to use a decision-tree to save our business-rules.
Rules are existing and extended frequently.
Due to the complexness a hierarchical tree would fit in.
(e.g. The Nested
Hlo,
We have all our tables as Innodb type. As I understand the variable
key_buffer_size is used only for MyISAM tables. Currently we have this var set
to 256M on a 4GB RAM machine. Only the Temporary tables created using (CREATE
TEMPORARY TABLE) will be of MyISAM type. And there are a lot of t
Pe 27 Sep 2006, la 10:29, Chris <[EMAIL PROTECTED]> a scris:
>Did you try using a space (' ') as the separator? Did you get an error?
And at 7:41 + 27/9/06, [EMAIL PROTECTED] wrote:
Yes, I did.
...
So, I need to specify somehow that the fields are delimited by any
number of spaces...
Ratheesh K J wrote:
I have checked the queries. They look quite ok. We have a lot lot of
CREATE TEMPORARY TABLE running every second.
How else can tmp tables be created? What is the exact relation between
missing index and tmp tables being created. Do you mean to say in sorting?
Sorting, gr
I have checked the queries. They look quite ok. We have a lot lot of CREATE
TEMPORARY TABLE running every second.
How else can tmp tables be created? What is the exact relation between
missing index and tmp tables being created. Do you mean to say in sorting?
- Original Message -
Fr
On 9/26/2006 4:02 PM, Dan Buettner wrote:
> Jorrit, it's a known behavior, not a bug.
>
> Recent versions of MySQL will, when given a zero (0) as a value for an
> auto incrementing identity column, simply fill in the next auto
> incrementing value ... unless you flip a switch to specifically tell
Pe 27 Sep 2006, la 10:29, Chris <[EMAIL PROTECTED]> a scris:
>
>[EMAIL PROTECTED] wrote:
>> hi, everyone!
>> I have a text file like this:
>> 10:10:00 0 0 1 99
>> 10:20:00 0 0 1 99
>> 10:40:00 11 3 4 83
>> 11:00:00 1
[EMAIL PROTECTED] wrote:
hi, everyone!
I have a text file like this:
10:10:00 0 0 1 99
10:20:00 0 0 1 99
10:40:00 11 3 4 83
11:00:00 1 1 2 97
11:05:00 2 1 1 96
I need to load this fi
On Wed, 2006-09-27 at 13:00 +0800, Wai-Sun Chia wrote:
> On 9/27/06, Arjun Bhandari <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > I have been using MS SQL for the last one year, however would not like to
>
> Huh? If you would NOT like to transition to MySQL, then why are you
> asking all these stuff?
Ratheesh K J wrote:
Hlo,
I got this Stat of MySQL. I want to know is there something to worry about,
especially the number of temp tables.
That looks like a sign of missing indexes.
Temporary tables shouldn't be created that often if your queries are
indexed properly, even though they're no
hi, everyone!
I have a text file like this:
10:10:00 0 0 1 99
10:20:00 0 0 1 99
10:40:00 11 3 4 83
11:00:00 1 1 2 97
11:05:00 2 1 1 96
I need to load this file into a table, but I cann
Hlo,
I got this Stat of MySQL. I want to know is there something to worry about,
especially the number of temp tables.
Key Reads/Key Read Requests = 0.007094 (Cache hit = 99.992906%)
Key Writes/Key Write Requests = 0.239130
Connections/second = 8.741 (/hour = 31467.279)
KB received/second =
59 matches
Mail list logo