Re: Moving Database from PC to Apple

2006-10-07 Thread Douglas Sims
ev.mysql.com/downloads/gui-tools/5.0.html and then from the MySQL Administrator program, choose "Backup". Good luck. I use a MacBook Pro for MySQL work also (mostly developing things that will run on a linux server) and I have been very pleased with it. Douglas Sims [EMAIL PRO

Re: Need to find last price and date product was sold

2006-09-28 Thread Douglas Sims
rans AS t2 ON t1.product_code = t2.product_code AND (t1.date_sold < t2.date_sold OR (t1.date_sold=t2.date_sold AND t1.id WHERE t2.product_code IS NULL ORDER BY t1.product_code; Douglas Sims [EMAIL PROTECTED] On Sep 28, 2006, at 10:12 AM, Peter Brawley wrote: Mike, What I need to d

Re: making varchar field to act like numeric field

2006-09-28 Thread Douglas Sims
| +-------+ 1 row in set, 1 warning (0.00 sec) Douglas Sims [EMAIL PROTECTED] On Sep 27, 2006, at 10:24 PM, [EMAIL PROTECTED] wrote: I am looking for any suggestions to this problem. I have a table with a varchar field. This field can hold textual or numeric data, but it is st

Re: Need to find last price and date product was sold

2006-09-27 Thread Douglas Sims
| -51.04| | 39 | 2005-07-31 | 1191.00 | | 40 | 2006-05-29 | 65.00 | +-++---+ 53 rows in set (0.52 sec) Douglas Sims [EMAIL PROTECTED] On Sep 27, 2006, at 11:36 PM, mos wrote: This should be easy but I can't find a way of doing it in 1 step

Re: where url = 'x' with url a TEXT field

2006-09-27 Thread Douglas Sims
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? Dougl

Re: Count of children

2006-09-27 Thread Douglas Sims
ystem variable to a nonzero value. See Section 5.2.3, “System Variables”, for more information. There is also a very thorough article discussing stored procedures in MySQL which gives an example of tree traversal here: http://dev.mysql.com/tech-resources/articles/mysql-storedprocedures.html Do

Re: SUM in WHERE

2006-09-24 Thread Douglas Sims
re the value is exactly 100. That would be the row with id=7. Here is a query which will give you that: SELECT * FROM tbl_name WHERE total=100 ORDER BY id LIMIT 1,1 Douglas Sims [EMAIL PROTECTED] On Sep 24, 2006, at 3:27 PM, Ahmad Al-Twaijiry wrote: Hi I need the result to be 100 not to mo

Re: SUM in WHERE

2006-09-24 Thread Douglas Sims
T) The easiest way to do this, of course, is as a subselect of another query but you could also do it in the perl/python/php/whatever layer which is sending this query to the database. Can you send a transcript of what you tried, including the "SHOW CREATE TABLE" statement? D

Re: Count Fields of a Table

2006-09-22 Thread Douglas Sims
(0.32 sec) mysql> select column_name from information_schema.columns where table_schema='test' and table_name='t'; +-+ | column_name | +-+ | TransactionDate | | amount | +-+ 2 rows in set (0.08 sec) Douglas Si

Re: Mysql pushing data to client

2006-09-21 Thread Douglas Sims
It will probably work better if you put the triggering code in the part of your application (like the PHP page, whatever) that changes the data you want to be notified about, instead of in the database itself. Douglas Sims [EMAIL PROTECTED] On Sep 21, 2006, at 3:14 PM, Dave at Mysql

Re: SUM in WHERE

2006-09-20 Thread Douglas Sims
amount1 | tot1 | +-+--+ | 178 | 198 | | 32.43 | 230.43305176 | | 3 | 233.43305176 | +-+--+ 3 rows in set (0.00 sec) Good luck! Douglas Sims [EMAIL PROTECTED] On Sep 19, 2006, at 4:02 PM, Quentin Bennett wrote: No, I

Re: How to delete all rows....

2006-09-20 Thread Douglas Sims
You might also look at TRUNCATE table... http://dev.mysql.com/doc/refman/5.0/en/truncate.html I believe that DELETE will not reclaim the storage space while TRUNCATE does, although I didn't see that in the documentation when I looked just now... ? Douglas Sims [EMAIL PROTECTED] O

Re: make mysqldump to sort columns alphabetically

2006-09-08 Thread Douglas Sims
ES | MUL | | | | address | varchar(32) | YES | | | | +-+-+--+-+-+---+ 3 rows in set (0.00 sec) Here is the mysql documentation on ALTER TABLE: http://dev.mysql.com/ doc/refman/5.0/en/alter-table.html Douglas Sims [EMAIL PROTECTED]

Re: problem with InnoDB

2006-09-06 Thread Douglas Sims
I wonder if the reason for the 20-second SELECT COUNT(*) which you are seeing might not have more to do with memory allocation on the server? Or perhaps Dan's suggestion that the InnoDB primary index holds the entire row might be the clue. How big are your rows? Note to self: stop

Re: problem with InnoDB

2006-09-06 Thread Douglas Sims
ction; if you created a second statement handle and did a SELECT FOUND_ROWS() on the same connection, perhaps that would give what you want. Douglas Sims [EMAIL PROTECTED] On Sep 6, 2006, at 11:29 PM, <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> wrote: Hi Dan, Thanks for yur

Re: select between date

2006-08-29 Thread Douglas Sims
, INTERVAL 7 DAY); +++ | name | birthdate | +++ | Keanu Reeves | 1964-09-02 | | Fred MacMurray | 1908-08-30 | +----++ 2 rows in set (0.00 sec) Good luck! Douglas Sims [EMAIL PROTECTED] On Aug 29, 20

Re: Conditional Insert

2006-08-28 Thread Douglas Sims
Much better. Good job. Douglas Sims [EMAIL PROTECTED] On Aug 29, 2006, at 1:26 AM, Johan Höök wrote: Hi Ravi, you can take a look at: http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html which might take care of your problem. /Johan Douglas Sims skrev: Hi Ravi You are

Re: Conditional Insert

2006-08-28 Thread Douglas Sims
| 7 | | Amy | 9 | | Doug | 22 | | Susan| 4 | | Tom | 2 | | Jim | 8 | | Elaine | 5 | +--+----+ 8 rows in set (0.00 sec) Good luck! Douglas Sims [EMAIL PROTECTED] On Aug 29, 2006, at 1:01 AM, Ravi Kumar. wrote: Hi Douglas

Re: Conditional Insert

2006-08-28 Thread Douglas Sims
v.mysql.com/doc/refman/5.0/en/replace.html Good luck! Douglas Sims [EMAIL PROTECTED] On Aug 29, 2006, at 12:08 AM, Ravi Kumar. wrote: Dear Members, I wish to insert and update conditionally into a table using a single SQL statement. That is if a record already exists in a table, the s

Re: First View

2006-08-24 Thread Douglas Sims
I was lucky enough to have gotten a copy of MySQL 10 (aka MySQL X) from the source tree before it was pulled. The query optimizer used predictive algorithms with temporal displacement logic, which meant that it could and did frequently return results in negative time, before the query was

Re: Help with query

2006-08-21 Thread Douglas Sims
XP '^[A-E]' You can read more about MySQL regular expressions here: http:// mysql.com/doc/refman/5.0/en/regexp.html Also, are you using spellcheck with Outlook Express? Because if so, Microsoft keeps trying to rename "MySQL" to be "Myself." I think they want

Re: Using Header to post data to another site

2006-08-16 Thread Douglas Sims
were doing what you describe I would use HTTPS and put both the un/pw and data in the body of the request, rather than trying to send one request to get a cookie and then use that cookie to send the actual data. Douglas Sims [EMAIL PROTECTED] *er, did I state that correctly? On Aug 16, 2

Re: Query Question

2006-08-14 Thread Douglas Sims
D'oh. Very good. I wish I'd thought of that. In response to Michael DePhillips' point about the UDF - I believe that in MySQL 5.x UDFs can't query tables. In Oracle, SQL Server, etc. they can and I'm sure they will in the future. Douglas Sims [EMAIL PROTECTED]

Re: Query Question

2006-08-14 Thread Douglas Sims
CTED] LIMIT 1; SELECT * FROM t WHERE id>(SELECT MIN(id) FROM t WHERE id>@id) ORDER BY id ASC LIMIT 1; But as to putting that in one statement... it might be better just to do it as three. Douglas Sims [EMAIL PROTECTED] On Aug 14, 2006, at 9:32 AM, Michael DePhillips wrote: Hi

Re: mysql naming convention

2006-08-11 Thread Douglas Sims
ns.id=user_permissions.permission; If you've never read Donald Knuth going on about Literate Programming you might check this out: http://www-cs-faculty.stanford.edu/~uno/ lp.html Just like with parenthesis styles, you can name database objects whatever you want and it will still

Re: mysqld-nt 100% CPU Utilization?

2006-07-20 Thread Douglas Sims
Can you do a "show processlist" from the MySQL client? This might help you to figure out if it is a specific query that's gumming up the works. Douglas Sims [EMAIL PROTECTED] On Jul 19, 2006, at 6:35 PM, Robinson, Eric wrote: Our MySQL-based medical application has be

Re: what are those MySQL files for?

2006-07-01 Thread Douglas Sims
Those are the files which contain the data in each table in your MySQL databases. I think the .myd files contain the data, the .myi files contain indexes, and the .frm files contain schema information. Douglas Sims [EMAIL PROTECTED] On Jun 30, 2006, at 11:47 PM, Octavian Rasnita wrote

Re: MySQL (GPL License)

2006-06-07 Thread Douglas Sims
lly's DB or use flat files written in Mandarin Chinese for all I care) for less money than we will spend on software on one upgrade cycle? Does anyone else have similar experiences? Douglas Sims [EMAIL PROTECTED] On Jun 7, 2006, at 11:15 PM, Douglas Sims wrote: Ouch. Thanks fo

Re: MySQL (GPL License)

2006-06-07 Thread Douglas Sims
reat support MS SQL had - I quickly agreed and said that MS SQL had the best support we could ever ask for... it's called "Google." Randy still paid for the lunch :-) Douglas Sims [EMAIL PROTECTED] On Jun 7, 2006, at 10:20 PM, mos wrote: At 08:15 PM 6/7/2006, you wrote:

Re: Copying tables sans data from one database to another

2006-06-07 Thread Douglas Sims
or indexes from the original table. If you need to do this, you can do it by using the mysqldump program to dump the table (just the structure or the structure and data) from the original database and then load it into the new one: http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html G

Re: MySQL (GPL License)

2006-06-07 Thread Douglas Sims
cellent product. So even if you don't need the commercial license, if your company depends upon MySQL, buying a commercial license, paying for training, attending conferences, or buying lots of t-shirts is nice. Douglas Sims [EMAIL PROTECTED] On Jun 7, 2006, at 7:58 PM, Logan, Dav

Re: How to find matching tables that have specific field name.

2006-06-07 Thread Douglas Sims
| | CHECKSUM| bigint(21) | YES | | | | | CREATE_OPTIONS | varchar(255) | YES | | | | | TABLE_COMMENT | varchar(80) | NO | | | | +-+--+--+-+-+---+ 21 rows in set (0.07 sec) Go

Re: Automatically add +1 every 30mins

2006-06-02 Thread Douglas Sims
---+ | 162 | +-+ 1 row in set (0.00 sec) Here is a reference to the MySQL documentation on date and time functions, which is really good: http://dev.mysql.com/doc/refman/5.0/ en/date-and-time-functions.html Good

Re: auto_increment Question

2006-06-01 Thread Douglas Sims
| NULL| NULL| NULL | | 5542 | 125| 1 | 443| NULL | || NULL | NULL| NULL| NULL | +--++---++--- +---+----+--+-+-

Effective-dating

2006-04-09 Thread Douglas Sims
as to do with meeting girls efficiently - which is also interesting, but outside the scope of this list and not immediately relevant to the system I'm working on. Douglas Sims [EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: database compatibility

2006-03-22 Thread Douglas Sims
st. Maybe I'm asking too much to find a summary of such differences. But I'm only interested in using mainstream sql functinality, nothing complicated. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: ~BCP for mysql~

2006-03-21 Thread Douglas Sims
Viruses! www.newbreak.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] Douglas Sims [EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://l

Re: what is the sql command to export the whole database ?

2006-03-19 Thread Douglas Sims
ion around http://mail.yahoo.com Douglas Sims [EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: Using Wildcards in Query

2004-01-27 Thread Douglas Sims
It sounds as if you need to use a regular expression. For very simple string comparisons, use =, as in _wbs='Fish'_ For more complex string comparisions with simple wildcards, use LIKE as in _wbs LIKE "%fish%" _For most complex comparisions, use a regular expression, as in _wbs REGEXP ".\d"_ In

Re: can't install DBI on panther

2004-01-26 Thread Douglas Sims
I installed DBI and dbd:mysql on 10.3.2 a few months ago and had all sort of problems but I finally got it to work. I don't exactly remember what finally did it, though. I think it might have been running the install with sudo, as in: sudo perl -MCPAN ... etc. but I'm not sure. If you haven't

Re: MYSQL Database

2004-01-20 Thread Douglas Sims
Hi You should check out: http://onlamp.com/ L.A.M.P. (Linux/Apache/MySQL/Perl(or PHP) are becoming the de facto standards for web-based applications, I think far eclipsing Java (JSP/Servlets) and Microsoft ASP/VB. Unlike Java (which is driven to a large degree by Sun's promotion) and ASP (he

Re: Question about IF statements...

2004-01-14 Thread Douglas Sims
e_worked, user_id, period_id) values (5, 'clh', '27'); Query OK, 1 row affected (0.00 sec) mysql> SELECT project_id, SUM(time_worked) AS total FROM time_daily WHERE user_id='clh' AND period_id='27' GROUP BY project_id HAVING total>0 -> ; +--

Re: Question about IF statements...

2004-01-14 Thread Douglas Sims
Would something like this do what you want? SELECT project_id, SUM(time_worked) AS total FROM time_daily WHERE user_id='clh' AND period_id='27' GROUP BY project_id HAVING total>0; Cory Hicks wrote: Hello, I must be having a goober moment.I am running the following sql query with no probl

Re: Importing a dumpfile

2004-01-13 Thread Douglas Sims
Hi Mat mysqldump produces files containing SQL statements. mysqlimport allows you to load data from comma-delimited (or other) text files. For example, the following line will dump the contents of the table 'goat_painters' in the database 'the_goat_database' into a file called 'goat_painters.

Re: Optimization help

2004-01-12 Thread Douglas Sims
I think... you don't have an index on the "Incident" field itself, just on (Date, Incident, Type, Task) which means that it concatenates those fields and orders the result - thus this may be virtually useless if you're looking for a specific incident within a large date range. Since your query

Re: Error 1044

2004-01-07 Thread Douglas Sims
Both mysql and mysqladmin get user info for login purposes from the same place: the mysql.user table. Mysql doesn't have a root password set by default after installation. It's very easy to overlook this and not set a password. One might think that the user you're logging into mysql with will

Re: MySQL certification

2004-01-05 Thread Douglas Sims
Thanks, Stefan. Mike's article was interesting. The test was a bit harder than I anticipated. I should have paid more attention to column types and database name, among other things. But I did pass - at least, the preliminary report said pass, but also said that the exam will be reviewed and

MySQL certification

2004-01-04 Thread Douglas Sims
I'm scheduled to take the MySQL certification exam tomorrow morning, thus currently intently cramming with the MySQL reference manual and writing out study notes etc. I'm not too worried as I've been using MySQL for years (although preping for this has been a good exercise and I've learned a nu

Re: Join sintax question

2004-01-04 Thread Douglas Sims
Hi Giulio I think you could do this by repeatedly left-joining the categories table as in this: SELECT AudioTrack.* FROM AudioTrack A LEFT JOIN AudioTracks_Categories C1 ON A.AudioTrack_id=C1.AudioTrack_id LEFT JOIN AudioTracks_Categories C2 ON A.AudioTrack_id=C2.AudioTrack_id LEFT JOIN AudioTra

Re: BUG IN MYSQL

2004-01-03 Thread Douglas Sims
I also ran the test, using MySQL 4.0.16, for apple-darwin6.6 (powerpc) on a Mac iBook G4 w/Panther and got no errors from mysqlcheck. You might try using mysqlbug to compose the bug report: http://www.mysql.com/doc/en/Bug_reports.html Hassan Schroeder wrote: Richard S. Huntrods wrote: I've

Re: Change from loop to single query

2004-01-02 Thread Douglas Sims
You probably want the IN comparison operator (http://www.mysql.com/doc/en/Comparison_Operators.html) For example: UPDATE users SET status=no WHERE name IN ('Joe', 'Wally', 'Bob', 'Cynthia'); Of course, you can create this statement from the list of names by joining all of the names with commas