Re: How to do in one SELECT... and now for Performance

2005-07-29 Thread René Fournier
Thanks, this is very helpful. I'm finally starting to understand Joins. But now I have a serious performance problem. Using INNER JOIN... SELECT users.*, COUNT(history.user_id) as num_events FROM users INNER JOIN history ON (users.id = history.user_id) GROUP BY users.user_name ORDER BY id DESC

Re: Persistent Corruption

2005-07-29 Thread Terence
Also check your kernel version. We had the same problems running on the old RH 7.3 kernel (2.4.17 was it?) After upgrading to RH9 it was fine. Chris McKeever wrote: MySQL 4.0.16 I am having this annoying persistent corruption issue, and am wondering if anyone has any suggestions. I have two t

Re: Phone Number Column Advice

2005-07-29 Thread Peter Brawley
Scott Purcell wrote: >I am waffling on how to handle a column of phone numbers. I am >not sure what is common practice on the database side. Talking to >some co-workers, some feel it would be fine to use a varchar and >others think there should be 3 integer columns in the database >for each numbe

Blob retrieval from database using shell

2005-07-29 Thread Rakesh Gupta
Hi There, I am trying to insert blob in table and then retrieve it from table using Linux shell. Here is script that i used. Load Blob into DB and Retrieve it using linux shell. # add firmware into DB ACTION="insert into FIRMWARE (firmwarename, releasedate, bootcodename, usermanualname, releas

Re: How to do in one SELECT

2005-07-29 Thread Ed Reed
select USERS.Name, Count(WINS.user_id) >From USERS inner join WINS on WINS.user_id = USERS.id Group By USERS.Name >>> René Fournier <[EMAIL PROTECTED]> 7/29/05 4:40 PM >>> Let's say I have two tables: USERS id name 1 John 2 Mary 3 Sue 4 Paul 5 David WINS id user_id 1 2 2 4 3 3 4 5 5 1 6 4 7 4

How to do in one SELECT

2005-07-29 Thread René Fournier
Let's say I have two tables: USERS id name 1John 2Mary 3Sue 4Paul 5David WINS iduser_id 12 24 33 45 51 64 74 82 93 10 1 How can—in one SELECT statement—fetch and display all the users, along with the number of games they each

Re: Group Summary by Month

2005-07-29 Thread Rhino
I think you need to start with GROUP BY. You'll need something along this line: select partno, month, sum(cost) from mytable group by partno, month; This ensures that you get one summary row showing the total cost of for each part number for each month. Naturally, you can add WHERE conditions

Re: Help Table Types Causing Issues

2005-07-29 Thread SGreen
"Scott Purcell" <[EMAIL PROTECTED]> wrote on 07/29/2005 04:44:10 PM: > Hello, > > I have created a table for items. And I needed some of the columns > to be searchable, so I created the table as: > a MyISAM for full text search. > > CREATE TABLE `item` ( > `parent_id` int(11) NOT NULL default

Help Table Types Causing Issues

2005-07-29 Thread Scott Purcell
Hello, I have created a table for items. And I needed some of the columns to be searchable, so I created the table as: a MyISAM for full text search. CREATE TABLE `item` ( `parent_id` int(11) NOT NULL default '0', `id` int(11) NOT NULL auto_increment, `manufacturer_id` varchar(50) default

Group Summary by Month

2005-07-29 Thread Ed Reed
I have a table that contains all the part number and cost transactions over time. I wanna get a get the summary cost of each part number for each month. For example, when I supply a single part number to this query the results should be something like this. +--+--+ | Month |

Export OpenOffice XML to Mysql

2005-07-29 Thread Alvaro Cobo
Hi guys: I have the following problem: In the organization I work for, we have several standard formats which we have to write for each project we manage (for example: reports). These are MS-Word documents, for which I have created a database and several forms to store this information. The

Re: Database equivalent to NorthWind for M$ SQL

2005-07-29 Thread Peter Brawley
Scott, >Is there any database file similiar to M$'s Northwind that I can use to play >with? It would be nice if there is one inside MySQL by default for newbies >to start out with. For our chapters on Connector/ODBC and dotNet, Arthur & I wrote scripts to create MySQL versions of the NW schem

Re: malloc troubles on 64-bit machine

2005-07-29 Thread Joerg Bruehe
Matthijs, thank you for your detailed description: Matthijs van der Klip wrote: [[...]] I'd like to start with the following: http://lists.debian.org/debian-kernel/2004/12/msg00410.html This implies I'm not the only one strugling with 'Active' memory on a 2.6 kernel. Interesting detail: th

Database equivalent to NorthWind for M$ SQL

2005-07-29 Thread Scott Hamm
Is there any database file similiar to M$'s Northwind that I can use to play with? It would be nice if there is one inside MySQL by default for newbies to start out with. Microsoft's document often used Northwind as an example to teach functions. -- Power to people, Linux is here.

Re: InnoDB migration between servers

2005-07-29 Thread Andreas Unterkircher
> > When I strace the mysqld process it doesn't do anything, it's waiting > > Do you use the official binaries? There're additional InnoDB monitors > mentioned at: > http://dev.mysql.com/doc/mysql/en/innodb-monitor.html > > which could provide more information. My first try was with the incl

Re: mysql command line execution

2005-07-29 Thread Jason Pyeron
sorry, reply to error here On Fri, 29 Jul 2005, Nuno Pereira wrote: Michael Stassen wrote: You can, but why are you reinventing the wheel? Option files have already been provided for this purpose. In what way is storing the batch user password in 'password_file' better than than storing i

Re: making mysql-client for windows behave

2005-07-29 Thread Andy Pieters
Hi there Sorry about starting a new thread but I lost the original message Anyway Mr. Green suggested to change the settings on the shortcut, or on a copy of the shortcut, but that is just plain inpossible! I cannot change target or icon of the shortcut that was created by the MySql instal

Re: mysql command line execution

2005-07-29 Thread Joerg Bruehe
Hi! Nuno Pereira wrote: Michael Stassen wrote: [[...]] echo "unlock table " | mysql -udbuser -pdbpassword -Ddbname -hlocalhost -P3306 The password is on the command line of the commands issued by the script, so it can be seen with ps. That isn't true. If you make a ps, you will see som

Re: mysql command line execution

2005-07-29 Thread Nuno Pereira
Michael Stassen wrote: Nuno Pereira wrote: Michael Stassen wrote: Ehrwin Mina wrote: Jeff, You can make a shell script or a php script or a perl script by that way you can hide the commands you need to execute. eg. Make a shell script (myshell.sh) #!/bin/sh myuser=dbuser mypasswd=dbp

Re: mysql command line execution

2005-07-29 Thread Michael Stassen
Nuno Pereira wrote: Michael Stassen wrote: Ehrwin Mina wrote: Jeff, You can make a shell script or a php script or a perl script by that way you can hide the commands you need to execute. eg. Make a shell script (myshell.sh) #!/bin/sh myuser=dbuser mypasswd=dbpassword mydb=dbname myho

Re: Complete server lock

2005-07-29 Thread Ben Clewett
Michael, Thank for the reference. This is useful. Ben. Michael Stassen wrote: Ben Clewett wrote: JamesDR wrote: I noticed, on my Linux server, that MySQL makes a DNS lookup anyway. Even if the IP is used or not. It normally digs on the PTR record. I had all of my perms IP based, however,

Re: Complete server lock

2005-07-29 Thread Michael Stassen
Ben Clewett wrote: JamesDR wrote: I noticed, on my Linux server, that MySQL makes a DNS lookup anyway. Even if the IP is used or not. It normally digs on the PTR record. I had all of my perms IP based, however, it still looked at the PTR record. At the time I hadn't set any up in my DNS serv

Re: Migration from ORACLE 9i to MySQL

2005-07-29 Thread Sid Lane
from a purely religous logical architecture viewpoint it is better to keep the business rules as close to the persistence layer (ex. RDBMS) as possible. in the practical physical/business world it is severly hyperlinearly expensive (both hardware as well as Oracle licenses) to support that model.

Re: Complete server lock

2005-07-29 Thread Ben Clewett
JamesDR wrote: I noticed, on my Linux server, that MySQL makes a DNS lookup anyway. Even if the IP is used or not. It normally digs on the PTR record. I had all of my perms IP based, however, it still looked at the PTR record. At the time I hadn't set any up in my DNS server. After I added all

Re: Complete server lock

2005-07-29 Thread JamesDR
Ben Clewett wrote: Jigal, Thanks. I can confirm that there were no domains used for our permissions. All IP based. Although this may have been the cause, I don't think it was in this case. I think as well that DNS timeouts are in the region of 20 seconds to 2 minutes. Would any person k

Re: Help need search database

2005-07-29 Thread SGreen
Gregory Machin <[EMAIL PROTECTED]> wrote on 07/29/2005 08:00:07 AM: > Hi > Please could advise me. > > I need search all the tables in a database for a single string. I'm > trying to figure out how, where and what other tables exponent cms > saves it text pages and references to, so i can finish

Re: Complete server lock

2005-07-29 Thread Ben Clewett
Jigal, Thanks. I can confirm that there were no domains used for our permissions. All IP based. Although this may have been the cause, I don't think it was in this case. I think as well that DNS timeouts are in the region of 20 seconds to 2 minutes. Would any person know if there is any

Re: Phone Number Column Advice

2005-07-29 Thread Asad Habib
Hello. I posted a similar question a while back and received a bunch of responses. It depends on how you plan to use the numbers. If you plan to use them in calculations, then storing them as INTs is best. Also, breaking a number into separate components makes sense if you plan to use these compone

Re: Phone Number Column Advice

2005-07-29 Thread Martijn Tonies
Hi, > I am waffling on how to handle a column of phone numbers. I am not sure what is common practice on the database side. Talking to some co-workers, some feel it would be fine to use a varchar and others think there should be 3 integer columns in the database for each number? > > Anyone have ad

Phone Number Column Advice

2005-07-29 Thread Scott Purcell
Hello, I am waffling on how to handle a column of phone numbers. I am not sure what is common practice on the database side. Talking to some co-workers, some feel it would be fine to use a varchar and others think there should be 3 integer columns in the database for each number? Anyone have a

Re: Complete server lock

2005-07-29 Thread Jigal van Hemert
Ben Clewett wrote: It had been suggested that our DNS failed prior to this event. I don't think MySQL uses DNS, but I am not entirely sure. If the db, user, etc. tables in the mysql system database (containing privileges, etc.) contain host names instead of IP-addresses I suspect it needs a

Re: MAX select problem

2005-07-29 Thread Philippe Poelvoorde
Lee Denny wrote: Hello, I'm trying to get the date and amount of the most visits to my site over a given time period using : SELECT max(visits) as maximum FROM visit WHERE (((visit_date >= '$sdatestring') and (visit_date < '$edatestring')) and (site_id=$site_id)) This gives me the right figure

Re: MAX select problem

2005-07-29 Thread Jigal van Hemert
Lee Denny wrote: Hello, I'm trying to get the date and amount of the most visits to my site over a given time period using : SELECT max(visits) as maximum FROM visit WHERE (((visit_date >= '$sdatestring') and (visit_date < '$edatestring')) and (site_id=$site_id)) This gives me the right figure

Complete server lock

2005-07-29 Thread Ben Clewett
Dear MySQL, Yesterday we had a complete lock on our MySQL 4.1.9. If I connected to it TCP, it would make the connection and hang. If I connected through the UNIX port, it would report no such file 'mysql.port'. If I 'kill' or used the stop, nothing would happen. Eventually I had to 'kill -9

Re: mysql command line execution

2005-07-29 Thread Nuno Pereira
Michael Stassen wrote: Ehrwin Mina wrote: Jeff, You can make a shell script or a php script or a perl script by that way you can hide the commands you need to execute. eg. Make a shell script (myshell.sh) #!/bin/sh myuser=dbuser mypasswd=dbpassword mydb=dbname myhost=localhost myport=330

MAX select problem

2005-07-29 Thread Lee Denny
Hello, I'm trying to get the date and amount of the most visits to my site over a given time period using : SELECT max(visits) as maximum FROM visit WHERE (((visit_date >= '$sdatestring') and (visit_date < '$edatestring')) and (site_id=$site_id)) This gives me the right figure, but when I try to

Re: concat function problems

2005-07-29 Thread averyanov
PS after mysql reinstallation (upgrade from 4.1.12 to 4.1.13) from source code with EXACTLY THE SAME ./configure options as before and the SAME configuration file everything is OK -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql

Re: mysql command line execution

2005-07-29 Thread Michael Stassen
Ehrwin Mina wrote: Jeff, You can make a shell script or a php script or a perl script by that way you can hide the commands you need to execute. eg. Make a shell script (myshell.sh) #!/bin/sh myuser=dbuser mypasswd=dbpassword mydb=dbname myhost=localhost myport=3306 db1=mysql -u$myuser -

Re: Help need search database

2005-07-29 Thread Pat Adams
On Fri, 2005-07-29 at 14:00 +0200, Gregory Machin wrote: > I need search all the tables in a database for a single string. I'm > trying to figure out how, where and what other tables exponent cms > saves it text pages and references to, so i can finish writing a mass > page import module > > In

Re: malloc troubles on 64-bit machine

2005-07-29 Thread Matthijs van der Klip
On Fri, 29 Jul 2005, Jigal van Hemert wrote: > I do not know exactly which speedup optimizations might be taken in > Fedora Core 4 (as mentioned in your first posting) in general, or in a > 64 bit version specifically, so I am speculating: > > A running MySQL server as configured by you, with 7 GB

RE: Migration from ORACLE 9i to MySQL

2005-07-29 Thread Nguyen, Phong
Thank you for your input, V/R, Phong -Original Message- From: Martijn Tonies [mailto:[EMAIL PROTECTED] Sent: Friday, July 29, 2005 3:41 AM To: Johnson, Michael ; [EMAIL PROTECTED] Cc: mysql@lists.mysql.com; 'Nguyen, Phong' Subject: Re: Migration from ORACLE 9i to MySQL Shawn, others,

RE: Migration from ORACLE 9i to MySQL

2005-07-29 Thread Nguyen, Phong
Shawn Green, You are right? I agree as you said "Sure MySQL may have a few fewer "bells and whistles" than Oracle but if you don't need to rely on all of the gee-whiz and just need fast, stable data storage and retrieval, MySQL is an excellent choice". Thank you for input, Nguyen -Orig

Help need search database

2005-07-29 Thread Gregory Machin
Hi Please could advise me. I need search all the tables in a database for a single string. I'm trying to figure out how, where and what other tables exponent cms saves it text pages and references to, so i can finish writing a mass page import module In short can mysql do a recursive search

Re: concat function problems

2005-07-29 Thread averyanov
resuming all above i can say that to my greatest regret nobody even expects what the matter is :( so i'll just try to install a newer version of server hoping the bug will disappear -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mys

Re: tmestamp resolution problem (rounding off to a day)

2005-07-29 Thread Nick
Jigal van Hemert wrote: Nick Sinclair wrote: "[.] WHERE date_format(timestamp, '%Y-%m-%d %T') <=DATE_SUB(CURDATE(),INTERVAL $BLACKLIST_DECAY HOUR)" * ...It only resolves to the DAY and not an hourly resolution. I have included a script below that I use for debugging, the MySQL functionalit

Re: mysql command line execution

2005-07-29 Thread Ehrwin Mina
Jeff, You can make a shell script or a php script or a perl script by that way you can hide the commands you need to execute. eg. Make a shell script (myshell.sh) #!/bin/sh myuser=dbuser mypasswd=dbpassword mydb=dbname myhost=localhost myport=3306 db1=mysql -u$myuser -pmypasswd -Dmydb -h

Re: tmestamp resolution problem (rounding off to a day)

2005-07-29 Thread Jigal van Hemert
Nick Sinclair wrote: "[.] WHERE date_format(timestamp, '%Y-%m-%d %T') <=DATE_SUB(CURDATE(),INTERVAL $BLACKLIST_DECAY HOUR)" * ...It only resolves to the DAY and not an hourly resolution. I have included a script below that I use for debugging, the MySQL functionality is taken directly from on

Re: Migration from ORACLE 9i to MySQL

2005-07-29 Thread Martijn Tonies
Shawn, others, > Maybe the US Air Force has an unlimited budget but the rest of us do not. > It seems to me that they "powers that be" in Nguyen's shop have made a > decision (rational or not, you know how some managers are) to move away > from a PREMIUM-priced package like 9i to something that ca

timestamp resolution problem (rounding off to a day)

2005-07-29 Thread Nick Sinclair
Hi All, I seem to be having a problem with the resolution using the timestamp function. I am accessing the database "snort" on an ACID/SNORT/MySQL installation utilizing a collection of shell scripts that are run as cron jobs and function as a "bot" adding and removing firewall rules (iptables

tmestamp resolution problem (rounding off to a day)

2005-07-29 Thread Nick Sinclair
Hi All, I seem to be having a problem with the resolution using the timestamp function. I am accessing the database "snort" on an ACID/SNORT/MySQL installation utilizing a collection of shell scripts that are run as cron jobs and function as a "bot" adding and removing firewall rules (iptables