sql query

2006-10-17 Thread Peter
... I hope I explain well In this case this is record 1 and record 3. How can I do this ? Thanks in advance for your help. Peter Send instant messages to your online friends http://uk.messenger.yahoo.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To

Re: sql query

2006-10-17 Thread Peter
Rolando Edwards wrote: > Dan's is correct because Thank you ALL for your kind help !!! Send instant messages to your online friends http://uk.messenger.yahoo.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PRO

Re: Got error 127 when reading table cat

2005-06-30 Thread Peter
that means you are running out of space on your machine or some specific partition Peter nikos wrote: Hello list Can somebody infor me what is the "Got error 127 when reading table cat"? Thank you Nikos -- Best regards, Peter http://AboutSupport.com -- MySQL General Mailin

Re: Help - need to quickly optimize a record count!

2005-07-06 Thread Peter
Or even make .txt file with the cron and just include that txt file in your php Then in backgrond with perl(php) and cron you will udate that .txt file :-) So it will be 1 quesry per 15 minutes :-) Peter [EMAIL PROTECTED] wrote: Brian Dunning <[EMAIL PROTECTED]> wrote on 07/06/2005

Re: creating socket

2005-10-10 Thread Peter
Hey, you need to tun mysql SERVERom what is the output of the command ps aux |grep mysql Peter Octavian Rasnita wrote: Hi, I have installed mysql and loaded mysqld, but I cannot connect to it with mysql because it gives an error telling that "it cannot connect using socket /var/lib/

The most frustrating thing

2005-11-27 Thread Peter
This has happened to me so many times I am finally going to ask. Why in the hell when I follow the directions given immediately after installing do I get an error? Here is what the thing says after installing (and I quote): " PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so,

Re: The most frustrating thing (correction)

2005-11-27 Thread Peter
--- Peter <[EMAIL PROTECTED]> wrote: > This has happened to me so many times I am finally going to ask. Why in > the hell when I follow the directions given immediately after installing > do I get an error? > > Here is what the thing says after installing (and I qu

u kwzzgitys

2005-12-28 Thread peter
The original message was received at Wed, 28 Dec 2005 09:08:42 +0100 from gerwinski.de [143.125.227.91] - The following addresses had permanent fatal errors - - Transcript of session follows - while talking to lists.mysql.com.: >>> MAIL From:[EMAIL PROTECTED] <<< 501 [EMAIL PRO

mysql make breaks

2006-01-06 Thread Peter
When building mysql on a x86 solaris 9 server and running make I get the following error: make[2]: Entering directory `/kit1/software/mysql-5.0.18/strings' gcc -c -o strings-x86.o strings-x86.s Assembler: "strings-x86.s", line 1 : Warning: Error in the # lineno from preprocessor

cannot delete row but permissions ok

2006-02-12 Thread Peter
| Y | Y | Y | Y | | 127.0.0.1 | spamassassin | amavisd | Y | Y | Y | Y | +---+--+-+-+-+---

Re: cannot delete row but permissions ok

2006-02-12 Thread Peter
--- Dan Trainor <[EMAIL PROTECTED]> wrote: > Peter wrote: > > While on MySQL 4.0.24, I connect to my database: > > > > $ mysql -u amavisd -ppassword spamassassin > > > > This user can select and insert (that is confirmed) but cannot delete > a > &

mysqlhotcopy

2006-02-23 Thread Peter
Hello, I read the manual(http://dev.mysql.com/doc/refman/5.0/en/mysqlhotcopy.html) and especially: " Back up tables in the given database that match a regular expression: shell> mysqlhotcopy db_name./regex/ The regular expression for the table name can be negated by prefixing it with a tilde

Re: mysqlhotcopy

2006-02-23 Thread Peter
solved :) Thanks :-) Peter wrote: Hello, I read the manual(http://dev.mysql.com/doc/refman/5.0/en/mysqlhotcopy.html) and especially: " Back up tables in the given database that match a regular expression: shell> mysqlhotcopy db_name./regex/ The regular expression for the table nam

Re: mysqlhotcopy

2006-02-24 Thread Peter
ysqlbackup/$1 Kind regards, Peter Imran Chaudhry wrote: Good stuff Peter, can you tell us your solution so folks can benefit from your efforts? (I expect the regex has to be POSIX style such as: mydb./'~(expirations|rtt)'/ right?) Imran Chaudhry -- http://www.ImranChaudhry.info MySQ

help: innodb database cannot recover

2013-06-20 Thread Peter
st to scrape up some info that will hopefully help diagnose the problem, but since we have already crashed, something is definitely wrong and this may fail. is there a way to start the database again? Thanks for your help in advance. Peter -- MySQL General Mailing List For list archives: http://

Re: help: innodb database cannot recover

2013-06-20 Thread Peter
2013/6/20 Peter Hello, > >I copied innodb database (ib_logfile0  ib_logfile1  ibdata1 and the whole >database directory) from one crashed machine to another. >I find that I cannot start database to get the database data any more. >How did you copy the database? >Manuel

Re: help: innodb database cannot recover

2013-06-20 Thread Peter
Am 20.06.2013 15:18, schrieb Peter: >> >>> I copied innodb database (ib_logfile0  ib_logfile1  ibdata1 and the whole >>> database directory) from one crashed machine to another. >>> I find that I cannot start database to get the database data any more. >

Re: help: innodb database cannot recover

2013-06-20 Thread Peter
Am 20.06.2013 15:18, schrieb Peter: >> >>> I copied innodb database (ib_logfile0  ib_logfile1  ibdata1 and the whole >>> database directory) from one crashed machine to another. >>> I find that I cannot start database to get the database data any more. >

Re: help: innodb database cannot recover

2013-06-20 Thread Peter
2013/6/20 Peter > >2013/6/20 Peter > >Hello, >> >>I copied innodb database (ib_logfile0  ib_logfile1  ibdata1 and the whole >>database directory) from one crashed machine to another. >>I find that I cannot start database to get the database data

Re: help: innodb database cannot recover

2013-06-20 Thread Peter
database? >>Manuel > >I copy the files ib_logfile0  ib_logfile1  ibdata1 into /var/lib/mysql in >linux and the whole database directory my_database_name into >/var/lib/mysql/my_database_name, the same location as previous machine  >/var/lib/mysql/my_database_name > > peter

Re: help: innodb database cannot recover

2013-06-21 Thread Peter
recovery=4 to restart mysql and then run mysqldump, i got the following error: mysqldump: Got error: 2013: Lost connection to MySQL server during query when using LOCK TABLES it looks that all data from innodb is messed up and gone forever even though *.frm is still there. Peter

Re: problems with mysql 4.1+suse 10

2008-01-02 Thread Peter
t; when i treat to create a new data base, appears this message. > please i need help. > thanks. > what exact command do you issue to create the DB ? Peter -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: OT: LAMP appliance for non-profit use

2006-12-09 Thread Peter
I think you look for something like: http://directadmin.com/ Peter Saqib Ali wrote: > Hello All, > > I know this is little bit off-topic but I think users of this group > can give good advice on this topic. > > We have a in-house built application using MySQL + P

Re: only update if values different

2006-12-09 Thread Peter
Hello, with good indeces 100 000 rows is basically nothing. Give it a try. Peter Nick Meyer wrote: > What is the best way to UPDATE a row only if values are different? We > have a mainframe extract that literally has 100,000 rows and am worried > about the performance of just runnin

indexes and size

2007-03-20 Thread Peter
not use it and goes over all 28 Million rows. If I use "force index" the query becomes even slower. Table type is Myisam. Please advise what should I tune so mysql uses the index without force index and query becomes faster. Thanks :-) Peter -- MySQL General Mailing List For li

Re: mysql and php

2005-05-29 Thread Peter
;skip-networking" if presenet 2. Make sure your user is allowed to make connections from YOUR_IP 3. Make sure you do not have Iptables rule that may block your access. Peter [EMAIL PROTECTED] wrote: Remember guys, I went through this on the phpmyadmin list before turning here. I wa

Re: Filling database with "load data"

2005-05-30 Thread Peter
hope this help. Peter [EMAIL PROTECTED] wrote: Hallo, I'm using MySQL 4.0.23a as found in the SlackWare 10.1 distribution. As I'm totally new to MySQL I tried tom follow the tutorial from the manual. When I tried to fill the data base using a text file with the command load data lo

Re: Which users eat cpu on Mysql

2005-06-10 Thread Peter
Hi, SHOW PROCESSLIST Peter Vahric MUHTARYAN wrote: Hi Everybosy , I red user-resources but I could't find any mysql user cpu usage limitation, instead of this How can I find out Who is sending too much query and How much cpu and memory eat ?! You know top showing only

Re: How to load a remote db with lots of data?

2005-06-13 Thread Peter
hi, do you have SSH access to the server ? Peter Brian Dunning wrote: I have to load my remote MySQL db's with about a gig of data - phpMyAdmin only allows me to upload a 15MB CSV file, so I have to painstakingly separate my data into 15MB chunks and upload them one at a time. I

newbie question

2003-11-28 Thread peter
database with different prefix's Can I keep adding more? is there a significant performance issue with multiple sites using the same database? I'm not really that up to speed on mysql or databases in general so.. any thoughts? thanks Peter [EMAIL PROTECTED] -- MySQL General Mailin

Mysql monitor

2004-03-03 Thread Peter
version info. I think about a perl script in cron job that do this. Is that the correct way ?. Any ideas which is better to the perl system call to myisamchk or 'REPAIR TABLE'...any ideas are appreciated ... Peter -- MySQL General Mailing List For list archives: http://lists.mysql.co

Re: Remote Connecting

2004-11-21 Thread Peter
Hello Danesh, what error do you get after the upgrade ? Peter Danesh Daroui wrote: Hi all, I have a Linux Fedora Core 3 machine which is supposed to act as database server and a Windows XP client. I had installed mysql server 4.1.5 before and I have defined remote user on my Linux machine as

Re: Help:how can i connect mysql server with the server's IP but not localhost?

2004-04-02 Thread Peter
Hi, You are using sockets to connect to localhost but tcp/ip for the network interface. Check in my ini NOT to have skip-networking BIVOL - Original Message - From: wen heping To: [EMAIL PROTECTED] Sent: Saturday, April 03, 2004 4:19 AM Subject: Help:how can i connect mysql server with th

Re: What is SAP R/3 Ver 4.6c installation procedure on PC?

2004-04-27 Thread Peter
The only source for this info is http://service.sap.com. Login with your S- user and download the pdf file. BIVOL - Original Message - From: Rahul Mandle To: mysql Sent: Tuesday, April 27, 2004 8:45 AM Subject: What is SAP R/3 Ver 4.6c installation procedure on PC? Sir,

FreeBSD 5.x

2004-06-05 Thread Peter
Hi, Does anybody have experience with FreeBSD 5.x & Mysql ? FreeBSD 4.x and mysql seems to be awful combination due to threading , but I have no tried FreeBSD 5.x with mysql under heavy load Thanks, Peter Zyumbilev Project Manager Mansion Productions Inc. AIM: peterZmansion

Re: FreeBSD 5.x

2004-06-06 Thread Peter
Hi, Thanks for the reply :-)) Any corruptions on MyIsam tables ? Cause in my case tables seems to crash a lot on the freebsd machines, processor almost die on 4.x ... Best regards, Peter Zyumbilev Project Manager Mansion Productions Inc. AIM: peterZmansion YMS: peterZmansion MSN: [EMAIL

Re: Err 2002 socks suck noway to start

2004-06-06 Thread Peter
# locate mysql.server # /path/to/mysql.server start what error it gives ? Peter Zyumbilev Project Manager Mansion Productions Inc. AIM: peterZmansion YMS: peterZmansion MSN: [EMAIL PROTECTED] Skype: peterZmansion ICQ: 108984925 support: http://support.hostmansion.com (24/7) email: [EMAIL

Re: Err 2002 socks suck noway to start

2004-06-06 Thread Peter
Blank does not mean bad try to connect with mysql client if not try #netstat -nvatp |grep mysql if you see nothing #locate .err You shold find some file lie .err #tail /path/to/that_file.err aslo you may try #cat /var/log/messages |grep mysql Peter Zyumbilev Project Manager Mansion

info...

2002-05-21 Thread Peter
hi there ... can some one point in the right direction .. other than the mysql manul for mroe information on the INSERT SELECT statement & whether or not it can handle date inserted from a form on a web page... Cheers Peter "the only dumb question is the one that was

Re: Is type of datetime & timestamp same??

2002-07-24 Thread Peter
Hi Jenny, The formatting are the same -MM-DD HH: - The timestamp field is set automatic by the system when updating a record. The date/time fields are for Your control and usage. Take a look in the manual 6.2.2.2 The DATETIME, DATE, and TIMESTAMP Types Best regards Peter

generic sample data script

2002-07-25 Thread peter
I'm looking for a script that will fill mysql tables with sample data so we can see how our web pages look with data in them. Does anyone know of any? I've written one in perl but I would like to see how someone else did it. tha

bug in mysql-test-run script (solaris)

2001-10-19 Thread peter
run mysql-test-run on solaris >Fix: change [ -e ] to [ -r "$BASEDIR/client/.libs/mysqltest" ] , which checks that the file exists (and is readable) in /bin/sh and /bin/bash alternatively, use [ -x ] (check exists and executable) >Submitter-Id: >Originato

Read size of MySQL db

2002-02-01 Thread Peter
How can I view/get the size of a MySQL database ? Many thanks, Peter M - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive

Re: MySQL/InnoDB-4.0.4 is released

2002-10-02 Thread Peter
Hi, I have been wondering if there is a schedule when MySQL 4.x is not considered "beta/developement" anymore - www.mysql.com recommend MySQL 4.x for testing only, and has done for some time now. Thanks and best regards Peter - Original Message - From: "Heikki

mysqld crashes on Redhat 8.0 when connecting to non-localhost

2002-10-18 Thread peter
led 021017 14:17:44 mysqld restarted /usr/libexec/mysqld: ready for connections >Originator: Peter Gordon >Organization: Valor >Synopsis: mysqld crashes on Redhat 8.0 when connecting to non-localhost >Severity: critical >Category: mysql >

Re: How to connect to mySQL?

2006-04-17 Thread Peter Brawley
徐晶 wrote: Hi, I want to know how I can connect to MySQL with ODBC driver? Is there something else to be installed besides MySQL for Windows? http://dev.mysql.com/doc/refman/5.1/en/odbc-connector.html PB Thanks a lot! Best Wishes, -- John Xu, EE, BUPT, P.R. China 北

Re: My Left Joins are Doubling the SUM()

2006-04-18 Thread Peter Brawley
mysql, My Left Joins are Doubling the SUM() SELECT packageItemID, packageItemName,packageItemPrice ,SUM(packageItemTaxAmount) as packageItemTaxAmount ,SUM(packageCreditAmount) as packageCreditAmount FROM packageItem LEFT JOIN packageCredit ON packageItemID=packageCreditItemID LEFT JOIN packageIte

Re: My Left Joins are Doubling the SUM()

2006-04-18 Thread Peter Brawley
mysql, Add a grouping clause to that query, ie SELECT packageItemID, SUM(packageItemPrice), ( SELECT SUM(c.packageCreditAmount) FROM packageCredit c WHERE c.packageCreditItemID = packageItemID ) AS CreditSum, ( SELECT SUM(t.packageItemTaxAmount) FROM packageItemTax t WHERE t.pac

Re: select records not in a *particular* many-to-many relationship

2006-04-18 Thread Peter Brawley
Marco, I've checked the archives and found an explanation as to how the check if a record is not in a many-to-many table. The answer to that is somewhat simple and clear to me. But here's my problem: how do you check if a record doesn't have a *particular* many-to-many relationship? As in,

where group and inner join

2006-04-19 Thread Peter Lauri
R JOIN tour_scorecard_hole tsh ON tps.scorecard_hole_id=tsh.id WHERE sum(tps.strokes) < 90 GROUP BY tps.tour_player_id ORDER BY score, back_9; It gives me error : Invalid use of group function Where does the error come from? And how would I solve this? Best regards, Peter Lauri -- My

RE: where group and inner join

2006-04-19 Thread Peter Lauri
Thanks. That worked smooth as silk! -Original Message- From: Dan Nelson [mailto:[EMAIL PROTECTED] Sent: Thursday, April 20, 2006 11:42 AM To: Peter Lauri Cc: mysql@lists.mysql.com Subject: Re: where group and inner join In the last episode (Apr 19), Dan Nelson said: > It's u

Re: where group and inner join

2006-04-20 Thread Peter Brawley
Peter, Best groupmember, I am doing this query that works fine. SELECT tps.tour_player_id, sum(if(tsh.hole_number<=9, tps.strokes, '0')) AS 'front_9', sum(if(tsh.hole_number>=10, tps.strokes, '0')) AS 'back_9', sum(tps.strokes

Re: Form value editing

2006-04-20 Thread Peter Brawley
Brian E Boothe wrote: can someone please just send me or post a example of editing feilds of a mysql database within an html form and then updating the values thanks alot Google for php,mysql,examples. PB -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7

Re: WHERE doesn't work

2006-04-22 Thread Peter Brawley
Tom, > UPDATE command is not working for only the record that I want, but for >all in the table. I sees WHERE is not interpretated by Mysql server. At >least the result is identic to it. For example, If my php execute > UPDATE clientes SET tipo='r', nome_fantasia='cc', estado='24' >W

Re: WHERE doesn't work

2006-04-23 Thread Peter Brawley
Tom, Maybe a comunication trouble... Let me confirm. Are you saying that http://www.spalha.com.br/spalha/DB_code.html http://www.spalha.com.br/spalha/insert_client_code.html are not the code Im having troubles? As the code Im having trouble were some secret or so? if ($yes){ $communicat

Re: totalizing of Rows please help!!

2006-04-24 Thread Peter Brawley
Brian, i have three Values in each row of my MySQL database, im needing to sum them in the table as they are displayed per Row ?? how do i do this ? Projectname Elecremain Controlremain otherremain Project1 2300 1600 25

Re: If exists query.

2006-04-24 Thread Peter Brawley
Paul, >> > > I am doing queries that produce a table that looks something like this: >> > > >> > > Count   | IP Address    | First Seen    | Last Seen | Days >> > > 5000  10.0.0.1   2005-12-10    2006-04-15  50* >> > > 6500  10.0.0.2   2006-04-01    2006-04-06  

Re: totalizing of Rows please help!!

2006-04-24 Thread Peter Brawley
Brian E Boothe wrote: i have three Values in each row of my MySQL database, im needing to sum them in the table as they are displayed per Row ?? how do i do this ? As Eugene said, VARCHAR values don't sum, since they are not numeric. Either cast the column values you wish sums of to a numeri

Re: Stumped again by joins

2006-04-25 Thread Peter Brawley
Chris, >select count(distinct uid) as c >from aptg_guides_restricted as r, aptg_guides as g .. See the extensive notes on comma and SQL2003 joins at http://dev.mysql.com/doc/refman/5.1/en/join.html. Lose the comma join, make it a SQL2003 (explicit inner) join. PB - At 15:56 +0200 25

Re: Accumilating Blog Comments

2006-04-25 Thread Peter Brawley
-Patrick wrote: $query_rsComments = sprintf("SELECT id_com WHERE idart_com=%s ORDER BY date_com ASC", $KTColParam1_rsComments); No FROM clause. Also, don't you need single quotes around %s? PB - can anyone see what Im trying to do here? basically, I want to match the id_com with an id

Re: Calculate LONG/LAT from ZIP+4 (positve vs. negative longitude)

2006-04-25 Thread Peter Brawley
Daevid Vincent wrote: My confusion is that I have some formulas to plug in these values, but it seems to me that if I use the wrong set of data, my zipcodes will be wrong too. I also don't understand why there is even such a difference. I can understand a few decimal points being different,

Re: How to select the last entry per item

2006-04-27 Thread Peter Brawley
Brian Hi, I hope this is the right list for this question. If not, I'm happy to get help on where to post this question.  Apologies in advance if this is an old question. We are designing a simple a tracking database with a table of entries showing the current location of each it

Re: How to select the last entry per item

2006-04-28 Thread Peter Brawley
(0.01 sec) PB - Shawn Green wrote: --- Peter Brawley <[EMAIL PROTECTED]> wrote: Brian Hi, I hope this is the right list for this question. If not, I'm happy to get help on where to post this question. Apologies in advance if th

Re: How to select the last entry per item

2006-04-28 Thread Peter Brawley
LOL, three late nights in a row, lose that last post o' mine. PB - Shawn Green wrote: --- Peter Brawley <[EMAIL PROTECTED]> wrote: Brian Hi, I hope this is the right list for this question. If not, I'm happy to get help on where to po

Re: How to select the last entry per item

2006-04-28 Thread Peter Brawley
FROM (   SELECT 'o1' AS TableName,customerid,shipcity,latest FROM o1   UNION ALL   SELECT 'o2' as TableName,customerid,shipcity,latest FROM o2 ) AS tmp GROUP BY customerid, shipcity,latest HAVING COUNT(*) = 1; PB - Peter Brawley wrote: LOL, three late nights in a row, lo

Re: Finding duplicates, etc.

2006-05-01 Thread Peter Brawley
Dirk, I would like to know where there ar duplicate accounts that do not have duplicate addresses. I think that at this point in time that these are included in the first query. I would like to separate these out to report on them. How about ... select account,ident,address from group15034_i

RE: Getting the previous months documents

2006-05-02 Thread Peter Lauri
06-05-02 and order by that. /Peter -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 02, 2006 3:04 PM To: mysql@lists.mysql.com Subject: Getting the previous months documents I have a database that stores documents relating to meetings. They have all

RE: Getting the previous months documents

2006-05-02 Thread Peter Lauri
x27; ORDER BY CONCAT(SUBSTRING(temptext, 7, 2),SUBSTRING(temptext, 4, 2), SUBSTRING(temptext, 1, 2)) DESC LIMIT 1 /Peter -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 02, 2006 3:28 PM To: Peter Lauri; mysql@lists.mysql.com Subject: Re: Getting

Re: sorting with php/mysql

2006-05-02 Thread Peter Brawley
Ross, This is my database. Nope, it's a table, not a database. ..I will use the item_id for the order but what if I want to change item_id 3 to item id 1? A primary key shouldn't be edited, and the literal value of an auto_increment column oughtn't to be relevant. If you really need a settabl

RE: Getting the previous months documents

2006-05-02 Thread Peter Lauri
o not use PHP to try to get a query to work. Try to understand the SUBSTRING command and CONCAT command first. Read the documentation on www.mysql.com. /Peter -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 02, 2006 5:07 PM To: Peter Lauri S

Re: Missing information Search

2006-05-03 Thread Peter Brawley
Robert >What I need to be able to do is find any values of K_Code in table 1 that don't >appear in table 2. SELECT t1.k_code FROM table1 t1 LEFT JOIN table2 t2 USING (k_code) WHERE t2.k_code IS NULL; PB - Robert Gehrig wrote: Hi I have two tables that are structured like so: Table 1:

DATEDIFF and TIMEDIFF

2006-05-03 Thread Peter Lauri
Best groupmember, I run version 3.23.58 and need to use something similar to DATEDIFF and TIMEDIFF to calculate difference between two a timestamp and current_timestamp(). Is there any other function that is working for version 3.23.58 that do the same job? Best regards, Peter Lauri -- MySQL

Re: How to rename a DB

2006-05-05 Thread Peter Brawley
Hardi Have a look at "Rename Database" at http://www.artfulsoftware.com/queries.php#16 PB Hardi OK wrote: Hi, Anybody know how can i safely and easily rename a database in MySQL 5.0.19. Have tried some tips from google results (most of them are for MySQL 4.x) but no luck till now

Sub-query optimizer improvements scheduled?

2006-05-06 Thread Peter Rosenthal
Out of interest is there any time on the roadmap to improve the query optimizer's handling of sub-queries as specified in http://dev.mysql.com/doc/refman/5.0/en/subquery-restrictions.html ? Thanks.

Re: [Fwd: Getting next birthdays]

2006-05-08 Thread Peter Brawley
> I need the birthdays from yesterday, today and the next 4 or 5 birthdays. You don;t need to manually compute every date component. Try something like ... SELECT ... WHERE DATE_SUB(NOW(),INTERVAL 1 DAY) <= mem.birthday AND DATE_ADD(NOW(),INTERVAL 5 DAY) >= mem.birthday ORDER BY mem.bir

Re: Case confusion

2006-05-09 Thread Peter Brawley
Marcus, I just noticed that a key field (emailaddress) in my db is case sensitive when it should not have been, so now I've got a bunch of what are effectively duplicate records. I'm having trouble picking them out so I can manually merge/delete them before changing the collation on the field

Re: comparing postgis with mysql

2006-05-09 Thread Peter Brawley
Parang Saraf wrote: hello, I am relatively new in this field. I am designing a database to store the events extracted from the oceans. This project later demands of publishing data on web. I am not able to decide which database to use. Mysql with spatial extension or the postgis

Re: Reporting child tables referencing a parnet table

2006-05-10 Thread Peter Brawley
Ben,: Dear MySQL, Can you please tell me if there is a way of listing all child tables which have a foreign key reference to a parent? Find children of db.table: SELECT c.table_schema,u.table_name,u.column_name,u.referenced_column_name FROM information_schema.table_constraints AS c INNER JOI

Re: SQL:2003 standard

2006-05-10 Thread Peter Brawley
Peng Yi-fan wrote: Hi, It seems that ISO do not support SQL:2003 standard for free but I really need a copy. Does anyone know where I can download it? Or does anyone have it? Any type will be just OK. There is a 2002 draft at http://xml.coverpages.org/SQLX-5wd-14-xml-2002-08.pdf. PB

Re: Reporting child tables referencing a parnet table

2006-05-10 Thread Peter Brawley
ur 'db' and 'table' values. PB - mysql> SELECT version(); +-+ | version() | +-+ | 5.1.6-alpha-log | +-+ But thanks, I think I can work with this and get the information I want. Regards, Ben. Peter Brawley wrot

Re: Reporting child tables referencing a parnet table

2006-05-11 Thread Peter Brawley
Ben, This excellent script from Peter takes over a minute to run, and only identified RI (Referential Integrity) to one level of nesting. If I try to delete a record and get 'a foreign key constraint fails', this returns instantly without any delay and to all nested levels of RI.

Re: PRINT statement?

2006-05-11 Thread Peter Brawley
Stephen Cook wrote: I appreciate it but SELECT isn't quite what I want. It adds an extra 4 to 6 lines to the output (drawing the table, headers, row counts, etc). PRINT simply outputs whatever comes after it: PRINT is not a SQL command. The mysql client (fortunately) does not speak Basic. T

Re: PRINT statement?

2006-05-12 Thread Peter Brawley
--silent option, thanks! Peter Brawley wrote: Stephen Cook wrote: I appreciate it but SELECT isn't quite what I want. It adds an extra 4 to 6 lines to the output (drawing the table, headers, row counts, etc). PRINT simply outputs whatever comes after it: PRINT is not a SQL command. The

Inserting ' into database

2006-05-14 Thread Peter Lauri
Hi all, Assume that I want to insert "Juanita O'Connell" into my database. How do I do that? The problem is the ' in her last name. If I just put it in it will be INSERT INTO thetable (name) VALUES ('O'Connell'); And that does not work :) How can I sol

Re: Need help with procedure

2006-05-15 Thread Peter Brawley
Barry wrote: Hello everyone! I have a table with saved clicks by users. Now i want to draw a graph with a php extension. Problem is: if i let me show the clicks, one day is missing. Because on that day noone clicked on the link. I use this query: SELECT DATE(c_clicktime) AS clicktime, count(c_id

Re: Need help with triggers

2006-05-15 Thread Peter Brawley
Daevid, >> > > This is my first trigger I'm trying to write. >> > > I have two tables. 'stores' and 'zipcodes'. >> > > I want to automatically set the latitude and longitude of the store using >> > > it's zipcode lookup in the zipcode table. >> > > DELIMITER $$; >> > > DROP TRIGGER `store_coo

Re: Baffled by error

2006-05-16 Thread Peter Brawley
Mike Blezien wrote: Hello, MySQL 4.1.12 trying to figure out why I keep getting this error with the following query: SELECT c.account_id,a.name,a.company,SUM(c.agent_product_time) AS mins FROM account a LEFT JOIN calls c ON c.account_id = a.id WHERE c.calldate >= DATE_SUB(NOW(),INTERVAL 14

Re: Baffled by error

2006-05-16 Thread Peter Brawley
DAY) AND c.agent_id = 9 GROUP BY a.account_id HAVING SUM(c.agent_product_time) >= 500 ORDER BY mins; PB - Mike Blezien wrote: Peter, - Original Message - From: "Peter Brawley" <[EMAIL PROTECTED]> To: "Mike Blezien" <[EMAIL PROTECTED]> Cc: "

Re: duration query: how to ?

2006-05-18 Thread Peter Brawley
Bob >I'd like to retrieve the total amount of time the articles have been in the >site from 2005-01-01 to 2005-01-31 and divide them by 365 (or 366 if leap >year). In a valid-time app like yours, it is usually more sound to mark "current" with a far-in-the-future date than with NULL. Arguably

Recursive query

2006-05-18 Thread Peter Lauri
| 999 | 2 | | 18 | Other | 999 | 2 | | 19 | Tools | 999 | 3 | | 20 | R&D Document | 999 | 3 | ++---+--+---+ Best regards, Peter Lauri -- M

Re: Recursive query

2006-05-18 Thread Peter Brawley
Peter, >Right now I am doing this with PHP and a recursive function, but is it >possible to do this directly with one query? SQL is not recursive, so you need an sproc. There are some examples with discussion at http://www.artfulsoftware.com/mysqlbook/sampler/mysqled1ch20.html

Re: Find invalid email formats using MySQL query.

2006-05-20 Thread Peter Brawley
Yesmin Patwary wrote: Dear All, My contact table has email field which contains many invalid email addresses. I find them using following php function. Is there a way to do that check in MySQL query? function emailValidate ($str) { $reg = "^([a-zA-Z0-9._-]+)@([a-zA-Z0-9-])+

Re: LEFT JOIN Multiple Tables

2006-05-22 Thread Peter Brawley
Scott >SELECT * >FROM UserInfo u, DslInfo d >LEFT JOIN DslExtra e ON d.DslID = e.DslID >LEFT JOIN ExtraAddr a ON a.UserID = u.UserID >WHERE u.UserID = d.UserID; >However it appears this syntax is not valid in MySQL 5.x Right, as the 5.x docs say, 5.x wants ISO-compatible explicit joins, ie SEL

Re: LEFT JOIN Multiple Tables

2006-05-22 Thread Peter Brawley
man/5.1/en/join.html). PB - Scott Peter Brawley wrote: Scott SELECT * >FROM UserInfo u, DslInfo d LEFT JOIN DslExtra e ON d.DslID = e.DslID LEFT JOIN ExtraAddr a ON a.UserID = u.UserID WHERE u.UserID = d.UserID;

Re: I think I need a join

2006-05-23 Thread Peter Brawley
Critters wrote: >I can get it to join on either countryA or countryB but not both :| SELECT d.id, d.day, c1.country, c1.id, c2.country, c2.id FROM days d INNER JOIN countries c1 ON d.countryA = c1.id INNER JOIN countries c2 ON d.countryB = c2.id ORDER BY d.id (Getting ready for the World Cup

Urgent problem

2006-05-23 Thread Peter Lauri
Best group member, My computer stopped working. And I was able to install Windows on another partition and now I face one problem. I was running Windows with MySQL 4.1. I have all C: working, and can access all files. The first question: Can I recover that data from MySQL? The second question:

[Solved] Urgent problem

2006-05-24 Thread Peter Lauri
It was just to copy the files from the DATA folder in the installation directory. That was easier then I thought. -Original Message- From: Peter Lauri [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 24, 2006 6:52 AM To: mysql@lists.mysql.com Subject: Urgent problem Best group member, My

Re: Noob: Converting to Inner Join

2006-05-24 Thread Peter Brawley
>Are there any advantages to converting this 'working' query below to >use INNER JOIN ? >If so, what would the correct syntax be ? > >SELECT category.name, page.name, content.title, content.body >FROM category, page, content >WHERE content.page_id = page.id >AND page.category_id = category.id >AND

Re: Noob: Converting to Inner Join

2006-05-24 Thread Peter Brawley
, content.body FROM category, page, content WHERE content.page_id = page.id AND page.category_id = category.id AND category.id =1 ORDER BY content.order_id ASC LIMIT 0 , 30 And at 11:52 -0500 24/5/06, Peter Brawley wrote: Explicit INNER JOINs are easier to read, easier to debug, and since 5.0.12 alwa

Re: Fun with Dates and Incentives.

2006-05-24 Thread Peter Brawley
Brian Re your schema,   --it's redundant to define PRIMARY and UNIQUE keys on the same column,   --why not an INT student id?   --what if two (eg married) students share an email account?   --comparing datetimes across multiple time zones will be simpler if you       set completed_modules.tim

  1   2   3   4   5   6   7   8   9   10   >