Re: Total Counts, Multi-Report Questions
In the last episode (Feb 12), Sue Cram said: I have a request for a list of database entries Select x,y,z, etc that is now working OK. I have several questions, however. Here they are: 1.. Can I add a total line at the bottom of the report (ex: Total Selected: 23) for the total number of entries that are listed in the report? It's your report, you can put whatever you want in :) Simply print the size of the resultset of your main query, or if whatever language/reporting tool you're using can't do that, just do a SELECT COUNT(*) with the same WHERE clause. 2.. I want to print the same information but sorted in a different order on a second page of the report. Can I do that in one Select statement? If your language supports it, you can re-sort your resultset with a custom comparison fuction and display it again. Otherwise, you'll need another SELECT. 3.. If I need multiple select statements, is there a delimiter that says This is the end of my first select statement - the next thing you see is going to be a new select statement, so that all the necessary pages can be printed together in one job? So you want the same records to be returned in two orders, but as one resultset? Stick two queries together with a UNION ALL keyword. http://dev.mysql.com/doc/mysql/en/union.html -- Dan Nelson [EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: certain content is causing an error with INSERT - please help
Hi leegold, I don't know what mysql_real_escape_string would do, because it isn't a standard-php-function. So I don't regard it and talk about the basics. In fact you have a string delimiter in Librarian's Edition so you have to escape it to make MySQL know where the string really ends. There are two possibilities: 1. Double the quote to Librarian''s Edition with $descrip_field=str_replace(','',$$descrip_field); 2. Use addslashes (as you described) to create Librarian\'s Edition. Both ways work. The disadvantage of the second one is, that you might get back a Librarian\'s Edition when you select from the database. In that case you can't decide whether the user wanted that content or it occurred because of escaping. Therefore I would always recommend the first way and never(!) trust on any automatic escaping PHP would do for you. By the way... you might get more probs when you have backslashes in you strings. You should double them, too. Frank I fixed it. But I'm not clear on why. The following code ie. taking the content and blatently putting the content through addslashes(): $descrip_field=addslashes($descrip_field); Fixed it. But the code: if (!get_magic_quotes_gpc()) { $descrip_field = mysql_real_escape_string($descrip_field); } Did *not* fix it. So, to simplify this. Why would addslashes work and the other code (which I see often as a recommend way to escape) not work? This is a PHP question I suppose but I wanted to end the thread. Sorry if I did not supply enough info up front for you to support.
AW: certain content is causing an error with INSERT - please help
OK, I use an older version of PHP where mysql_real_esacpe_strings isn't avail. But nevertheless I would always prefer double-quoting with $descrip_field=str_replace(','',$$descrip_field); This is because I got lot's of Problems with different languages on different databases when you try to make things easy of trust on automatism. This always works. Put all the checks and escapes into a function and call it instead of mysql_real_escape_string... Then everything will be fine. Frank Busch ... leegold wrote: I'm ripping hair out, here's the problem...I'm trying to insert content cited below into a field and it's causing this error, ie. there's content i just cannot insert into the DB an it's causing the following error message: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's Edition). Here's the content that will not insert: iHow to Get It: A Guide to Defense - Related Information Resources/i (DTIC, 2002; Librarian's Edition). A reference published by the Defense Technical Information Service. The inspiration for this document. Without special treatment the single quote (apostrophe) in Librarian's terminates the string, leaving the rest as nonsense SQL. I'm using PHP so I run the code below (note I think magic quotes might be enabled on my server so the mysql_real_escape_string in the code below might never be runned) but in any event it is escaped with: if (!get_magic_quotes_gpc()) { $descrip_field = mysql_real_escape_string($descrip_field); } The gpc stands for Get/Post/Cookie. I'd guess that $descrip_field didn't come directly from a Get, Post, or Cookie, so magic_quotes didn't affect it. In that case, you have to escape it by hand with mysql_real_escape_string, but you don't do that because magic_quotes_gpc is on. I think this is a good example of why magic_quotes is a bad idea. Better to turn it off and then *always* process your strings. I do the same escape for the title field tooThen futher down in the code actual INSERT code is: mysql_query(INSERT INTO howto.page (title, descrip) VALUES ('$title_field', '$descrip_field')) or die (Can't connect because .mysql_error()); $page_id1 = mysql_insert_id(); if ($page_id1 == '0' ) { die ('died : page_id1=0'); } It is good that you are checking for errors and printing them when you get them, but often the error comes from the SQL statement not being what you think it is (as happened here, I think). You would stand a better chance of catching that if you included the actual SQL in the error message. I would use something like $query = INSERT INTO howto.page (title, descrip) VALUES ('$title_field', '$descrip_field'); mysql_query($query) or die (Query: .$query.\n failed with error: .mysql_error().\n); That way, you see the actual query that was sent, as well as the error from mysql. What's wrong??? It inserts for everything else OK, but just won't insert when i try with the content i cited? Thanks, Lee G. Then leegold also wrote: I fixed it. But I'm not clear on why. The following code ie. taking the content and blatantly putting the content through addslashes(): $descrip_field=addslashes($descrip_field); Fixed it. But the code: if (!get_magic_quotes_gpc()) { $descrip_field = mysql_real_escape_string($descrip_field); } As I said, turn off magic_quotes, then use $descrip_field = mysql_real_escape_string($descrip_field); Did *not* fix it. So, to simplify this. Why would addslashes work and the other code (which I see often as a recommended way to escape) not work? This is a PHP question I suppose but I wanted to end the thread. Sorry if I did not supply enough info up front for you to support. mysql_real_escape_string() should work. The problem is that it wasn't being called when it needed to be. See http://us2.php.net/manual/en/function.mysql-real-escape-string.php and http://us2.php.net/manual/en/function.get-magic-quotes-gpc.php. Michael -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: slow query, how can i imporve it?
Chris, - Original Message - From: Chris Elsworth [EMAIL PROTECTED] Newsgroups: mailing.database.myodbc Sent: Saturday, February 12, 2005 2:14 PM Subject: Re: slow query, how can i imporve it? On Fri, Feb 11, 2005 at 10:45:46AM -0500, [EMAIL PROTECTED] wrote: Normally I do not reply to myself but I just realized that in my previous response I confused COUNT(*) (which is slow for InnoDB because it always does a table scan to resolve the version lock of each and every row) with Hello all, You just reminded me about this, I've been meaning to ask; are there any plans to fix this for InnoDB? It seems like quite a serious omission that InnoDB doesn't keep an accurate internal row count. Are there technical reasons why this isn't done, or is it in the TODO for any time soon? It's really one of the biggest things stopping me from switching wholly to InnoDB :( it is in the TODO: http://www.innodb.com/todo.php Note that most transactional databases do not keep a row count. There are performance reasons and technical problems in it. -- Chris Best regards, Heikki Tuuri Innobase Oy Foreign keys, transactions, and row level locking for MySQL InnoDB Hot Backup - a hot backup tool for InnoDB which also backs up MyISAM tables http://www.innodb.com/order.php Order MySQL technical support from https://order.mysql.com/ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Filtering non-ascii characters from mysql data, null, tab etc
On Fri, 11 Feb 2005 18:41:38 -0500, wrote: zzapper wrote: On Fri, 11 Feb 2005 12:46:29 +0100 (CET), wrote: Tom adapting your script, create table test (txt varchar(255)) Type=MyISAM; insert into test values('Some Text\nand some more'); update test set txt = replace(txt,'\n',''); BTW \n = null \0 seems to be something else Turns out my rotten character (they all seem to display as a hollow box) was a \r thanx zzapper (vim, cygwin, wiki zsh) -- No. \n is a newline, \r is a return, and \0 is the null character C uses to terminate strings. Continuing your example: mysql CREATE TABLE test (id INT, txt VARCHAR(255)); Query OK, 0 rows affected (0.01 sec) mysql INSERT INTO test VALUES (1, 'Some Text\0 and some more'), - (2, 'Some Text\nand some more'); Query OK, 2 rows affected (0.01 sec) Records: 2 Duplicates: 0 Warnings: 0 mysql SELECT * FROM test; +--+--+ | id | txt | +--+--+ |1 | Some Text| |2 | Some Text and some more | +--+--+ 2 rows in set (0.00 sec) mysql UPDATE test SET txt = REPLACE(txt, '\0', ''); Query OK, 1 row affected (0.13 sec) Rows matched: 2 Changed: 1 Warnings: 0 mysql UPDATE test SET txt = REPLACE(txt, '\n', ' '); Query OK, 1 row affected (0.00 sec) Rows matched: 2 Changed: 1 Warnings: 0 mysql SELECT * FROM test; +--+-+ | id | txt | +--+-+ |1 | Some Text and some more | |2 | Some Text and some more | +--+-+ 2 rows in set (0.00 sec) Michael Michael, Thanx got it sussed now! Any ideas on a more generic non-ascii filter, that could remove a range of characters? zzapper (vim, cygwin, wiki zsh) -- vim -c :%s%s*%CyrnfrTfcbafbeROenzSZbbyranne%|:%s)[R-T]) )Ig|:norm G1VGg? http://www.vim.org/tips/tip.php?tip_id=305 Best of Vim Tips -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Is there a Library of complex queries/inserts/queries?
Hi, Sometimes an example is worth a 1000 words. Does anyone know of a website with lists of mysql statement examples? ie a list of queries, a list of updates, list of inserts from simple examples to joins regexps etc zzapper (vim, cygwin, wiki zsh) -- vim -c :%s%s*%CyrnfrTfcbafbeROenzSZbbyranne%|:%s)[R-T]) )Ig|:norm G1VGg? http://www.vim.org/tips/tip.php?tip_id=305 Best of Vim Tips -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
select where multiple joined records match
I'm trying to figure out how to select all the records in one table which have multiple specified records in a second table. My MySQL is version 4.0.23a, if that makes a difference. Here's a simplified version of my problem. I have two tables, resources and goals. resources table: ID TITLE 1 civil war women 2 bunnies on the plain 3 North Carolina and WWII 4 geodesic domes goals table: ID RESOURCE_ID GRADE SUBJECT 1 11 English 2 11 Soc 3 12 English 4 21 English 5 23 Soc 6 32 English 7 41 English Now, how do I select all the resources which have 1st and 2nd grade English goals? If I just do: Select * from resources, goals where ((resources.ID = goals.RESOURCE_ID) and (SUBJECT=English) and ((GRADE=1) and (GRADE=2))); I'll get no results, since no record of the joined set will have more than one grade. I can't just put 'or' between the Grade conditions; that would give resources 1, 2, 3, and 4, when only 1 really should match. My real problem is slightly more complex, as the 'goals' table also contains an additional field which might be searched on. I'm thinking it's time for me to go into the deep end of SQL (MySQL, actually), and my old O'Reilly MySQL mSQL book isn't doing the trick. Surely this has come up before - thanks for any guidance. - AM Thomas -- Virtue of the Small / (919) 929-8687 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
My Problem.Help me
Dears,I have following Makefile : INCS=-I/usr/include/mysql LIBS=-L/usr/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm LIBS_R=-L/usr/lib/mysql -lmysqlclient_r -lpthread -lz -lcrypt -lnsl -lm -lpthread MYSQL_LIBS=-L/usr/lib/mysql -lmysqld -lpthread -lz -lcrypt -lnsl -lm -lpthread -lrt CXXFLAGS=-march=i486 -mcpu=i686 CXX=g++ sql2sql : sql2sql.o $(CXX) $(LIBS) $(LIBS_R) $(MYSQL_LIBS) -o sql2sql sql2sql.o ; sql2sql.o : sql2sql.cpp $(CXX) -c $(INCS) core.cpp mysql_engine.cpp sql2sql.cpp; clean : rm -rf sql2sql.o mysql.o core.o But when i run make utility,I receive following error: g++ -L/usr/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm -L/usr/lib/mysql -lmysqlclient_r -lpthread -lz -lcrypt -lnsl -lm -lpthread -L/usr/lib/mysql -lmysqld -lpthread -lz -lcrypt -lnsl -lm -lpthread -lrt -o sql2sql sql2sql.o ; /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../../i486-slackware-linux/bin/ld: cannot find -lmysqld collect2: ld returned 1 exit status make: *** [sql2sql] Error 1 My distro is Slackware 10.0 .I didn't add anything to my Linux.It mean i just i don't install everything to my Linux. Please help me.. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Error detection
Hi all, Does anyone know how to detect if error occurred during runtime in a transaction block? For example : Begin tran A Drop table X #error will occurred because there is no table X #if error occurred go to exit point. This is the sql code I'm asking. COMMIT TRAN A Exit : ROLLBACK TRAN A Thanks, Felix Ang -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
AW: AW: Slow Replication
We did get the problem kind of solved up to now. We basically use as advised the option innodb flush_log_at_trx_commit=2. This did get the timelage solved. I still do not really understand why we had to speed the slave up like this because it should have been faster due to the hardware already. I guess it is just as Alec said that the fact of using a single-threaded Slave-SQL thread slows the slove down a whole lot. Does anyone have any solution or suggestion how to work around that? I don't really feel good using the flush_log_at_trx_commit option. P.S.: The old Show Master or slave status information basically showed that the I/O Thread has been up to date and the SQL Thread of the slave lagged. Thank you, Hannes Rohde -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 10. Februar 2005 13:15 An: [EMAIL PROTECTED] Cc: mysql@lists.mysql.com Betreff: Re: AW: Slow Replication Hannes Rohde [EMAIL PROTECTED] wrote on 10/02/2005 11:44:13: I don't think we are dealing with an IO bottleneck here because the slave server should quite faster with writings to the disc at least since we are using Raid 0 here. Or is there any way which could explain an IO bottleneck even though the slave is not running as many selects as the master is? In this case we are talking about one replicated database on a dedicated slave system. As I understand the previous posts, the problem is that the replication process is single-threaded while the updates on the original master are multi-threaded. On the original server, if Update 1 stalls because it has to fetch data of disk, Update 2 can proceed. If Update 2 stalls, Update 3 can proceed - and so on. This means firstly that Updates which can take advantage of the cache take no effective time - they come in, do their job, and exit while peer updates are stalled in Disk wait. This also means that lower-level software can optimise disk performance by re-ordering IO operations to minimise head movements. In my experience, having up to 4 parallel streams of disk operations, and allowing the disk to pick its preferred order of execution, usually adds about 50% to disk performance and can double it. However, when they are replicated to the slave server, the updates are put into a strictly First In, First out queue. If Update 1 stalls, Update 2 cannot be started - and nor can Update 3. When Update 3 does finally start, it cannot overlap the others, so that the time it takes, albeit small because it does not access disk, is added on to the other times rather than included within them. And since you are performing strictly one operation at a time (on the Updates side at least) Raid 0 does not help you, because there are no overlapping reads to get from alternate disks. Alec Cawley -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Importing a separated file into mysql, national charset problem??
I'm importing a file into mysql. Most work fien, but numbers are given like this : `487,90`116,40`4467,00` This creates a problem, as the decimal numbers are NOT read... i.e i get 487.00 , 116.00 in my database. Is this a national problem as we use komma as a decimal seperator in Norway? Do i set this in windows or in LOAD DATA INFILE statement?? Oddvar Kragseth
Re: Importing a separated file into mysql, national charset problem??
Original Message From: Oddvar Kragseth [EMAIL PROTECTED] To: mysql@lists.mysql.com; [EMAIL PROTECTED] Sent: Sunday, February 13, 2005 3:35 PM Subject: Importing a separated file into mysql, national charset problem?? I'm importing a file into mysql. Most work fien, but numbers are given like this : `487,90`116,40`4467,00` This creates a problem, as the decimal numbers are NOT read... i.e i get 487.00 , 116.00 in my database. Is this a national problem as we use komma as a decimal seperator in Norway? Do i set this in windows or in LOAD DATA INFILE statement?? We have this problem too in Czech Republic :-) I resolve this problem using this method: 1) I create temporary table with identical tructure except decimal, real, double, float and numeric fields. All this fields (eg. NUMERIC(6,2) ) I define as VARCHAR with the same length. 2) I load data into temporary table using LOAD DATA INFILE 3) I convert all numeric values using UPDATE TABLE temptable SET numeric_field=REPLACE(numeric_field, ',' , '.') 4) I load (or append) data from temporary table into main table. Petr Vileta http://www.zivnosti.cz http://www.practisoft.cz -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: select where multiple joined records match
Have a look at the manual page for EXISTS, you appear to need something like SELECT * FROM resources AS r WHERE EXISTS ( SELECT resource_id FROM goals AS g WHERE g.resource_id = r.id AND grade=1 AND subject='English' ) AND EXISTS ( SELECT resource_id FROM goals AS g WHERE g.resource_id = r.id AND grade=2 AND subject'English' ) PB - AM Thomas wrote: I'm trying to figure out how to select all the records in one table which have multiple specified records in a second table. My MySQL is version 4.0.23a, if that makes a difference. Here's a simplified version of my problem. I have two tables, resources and goals. resources table: ID TITLE 1 civil war women 2 bunnies on the plain 3 North Carolina and WWII 4 geodesic domes goals table: ID RESOURCE_ID GRADE SUBJECT 1 11 English 2 11 Soc 3 12 English 4 21 English 5 23 Soc 6 32 English 7 41 English Now, how do I select all the resources which have 1st and 2nd grade English goals? If I just do: Select * from resources, goals where ((resources.ID = goals.RESOURCE_ID) and (SUBJECT=English) and ((GRADE=1) and (GRADE=2))); I'll get no results, since no record of the joined set will have more than one grade. I can't just put 'or' between the Grade conditions; that would give resources 1, 2, 3, and 4, when only 1 really should match. My real problem is slightly more complex, as the 'goals' table also contains an additional field which might be searched on. I'm thinking it's time for me to go into the deep end of SQL (MySQL, actually), and my old O'Reilly MySQL mSQL book isn't doing the trick. Surely this has come up before - thanks for any guidance. - AM Thomas -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 265.8.7 - Release Date: 2/10/2005 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
2+1 MySQL Questions
Hi all I've installed MySQL on my Ubuntu Linux system. Then I installed MySQL Query Browser on my Win XP laptop. I've created a user for the MySQL which in the host field I've put %, I guess it means access from every IP (am I right?) But I cant connect to the MySQL instance. What could be wrong? Also, I created the user using mysqlcc but it doesn't save the password. I created a user with a password but I can only login with that user when I don't pass the password. How can I create users manually? Is there any commands for this? And finally, is there a .deb package available for MySQL Query Browser and Administrator? Best Regards, -- Behrang Saeedzadeh http://www.jroller.com/page/behrangsa -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Where's my ODBC icon?
I just installed MySQL's ODBC program, but I can't figure out how to launch it. I see no reference to ODBC when I go to Start Programs. The only thing resembling an executable icon I can find is in my Add/Remove programs directory. I did a Windows search and found many files named ODBC, most of them in Windows/Prefetch and Windows/system32, but none of them appear to be executable programs. I posted a message on MySQL's ODBC forum but haven't received any replies. Does anyone know of a way to locate ODBC's executable file and create a desktop icon? Thanks. __ Do you Yahoo!? Yahoo! Mail - Find what you need with new enhanced search. http://info.mail.yahoo.com/mail_250 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Where's my ODBC icon?
I just installed MySQL's ODBC program, but I can't figure out how to launch it. I see no reference to ODBC when I go to Start Programs. The only thing resembling an executable icon I can find is in my Add/Remove programs directory. I did a Windows search and found many files named ODBC, most of them in Windows/Prefetch and Windows/system32, but none of them appear to be executable programs. I posted a message on MySQL's ODBC forum but haven't received any replies. Does anyone know of a way to locate ODBC's executable file and create a desktop icon? I think the path is to configure ODBC datasources: %SystemRoot%\system32\odbcad32.exe There isn't a MySQL ODBC executable as far as I know. -- mack / -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Where's my ODBC icon?
--- Neculai Macarie [EMAIL PROTECTED] wrote: I just installed MySQL's ODBC program, but I can't figure out how to launch it. I see no reference to ODBC when I go to Start Programs. The only thing resembling an executable icon I can find is in my Add/Remove programs directory. I did a Windows search and found many files named ODBC, most of them in Windows/Prefetch and Windows/system32, but none of them appear to be executable programs. I posted a message on MySQL's ODBC forum but haven't received any replies. Does anyone know of a way to locate ODBC's executable file and create a desktop icon? I think the path is to configure ODBC datasources: %SystemRoot%\system32\odbcad32.exe There isn't a MySQL ODBC executable as far as I know. -- mack / OK, I found it there...but how do you start it? Double clicking it just brings up all sorts of information and choices. I installed ODBC before but never got a chance to do much with it before my computer crashed. But I could have sworn there was a simple icon that I clicked to start it, just like a normal software program. Thanks. __ Do you Yahoo!? The all-new My Yahoo! - What will yours do? http://my.yahoo.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Where's my ODBC icon?
David, I installed ODBC before but never got a chance to do much with it before my computer crashed. But I could have sworn there was a simple icon that I clicked to start it, just like a normal software program. My recollection is that ODBC installation normally adds ODBCAdmin to the Start Menu, so it's probably there somewhere, but if you want a desktop icon for ODBC Administrator, right click on it in Windows Explorer and select 'Create a Shortcut'. PB David Blomstrom wrote: --- Neculai Macarie [EMAIL PROTECTED] wrote: I just installed MySQL's ODBC program, but I can't figure out how to launch it. I see no reference to ODBC when I go to Start Programs. The only thing resembling an executable icon I can find is in my Add/Remove programs directory. I did a Windows search and found many files named ODBC, most of them in Windows/Prefetch and Windows/system32, but none of them appear to be executable programs. I posted a message on MySQL's ODBC forum but haven't received any replies. Does anyone know of a way to locate ODBC's executable file and create a desktop icon? I think the path is to configure ODBC datasources: %SystemRoot%\system32\odbcad32.exe There isn't a MySQL ODBC executable as far as I know. -- mack / OK, I found it there...but how do you start it? Double clicking it just brings up all sorts of information and choices. I installed ODBC before but never got a chance to do much with it before my computer crashed. But I could have sworn there was a simple icon that I clicked to start it, just like a normal software program. Thanks. __ Do you Yahoo!? The all-new My Yahoo! - What will yours do? http://my.yahoo.com -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 265.8.7 - Release Date: 2/10/2005 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: 2+1 MySQL Questions
Creating users in mysql is: GRANT ALL|[CREATE|UPDATE|etc.)] PRIVILEGES ON dbname.tablename TO [EMAIL PROTECTED] IDENTIFIED BY password If you want to check the grants to see if you've created that user correctly, try: SHOW GRANTS FOR [EMAIL PROTECTED] Michael -Original Message- From: Behrang Saeedzadeh To: mysql@lists.mysql.com Sent: 2/13/2005 1:42 PM Subject: 2+1 MySQL Questions Hi all I've installed MySQL on my Ubuntu Linux system. Then I installed MySQL Query Browser on my Win XP laptop. I've created a user for the MySQL which in the host field I've put %, I guess it means access from every IP (am I right?) But I cant connect to the MySQL instance. What could be wrong? Also, I created the user using mysqlcc but it doesn't save the password. I created a user with a password but I can only login with that user when I don't pass the password. How can I create users manually? Is there any commands for this? And finally, is there a .deb package available for MySQL Query Browser and Administrator? Best Regards, -- Behrang Saeedzadeh http://www.jroller.com/page/behrangsa -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: select where multiple joined records match
AM Thomas wrote: I'm trying to figure out how to select all the records in one table which have multiple specified records in a second table. My MySQL is version 4.0.23a, if that makes a difference. Here's a simplified version of my problem. I have two tables, resources and goals. resources table: ID TITLE 1 civil war women 2 bunnies on the plain 3 North Carolina and WWII 4 geodesic domes goals table: ID RESOURCE_ID GRADE SUBJECT 1 11 English 2 11 Soc 3 12 English 4 21 English 5 23 Soc 6 32 English 7 41 English Now, how do I select all the resources which have 1st and 2nd grade English goals? If I just do: Select * from resources, goals where ((resources.ID = goals.RESOURCE_ID) and (SUBJECT=English) and ((GRADE=1) and (GRADE=2))); I'll get no results, since no record of the joined set will have more than one grade. I can't just put 'or' between the Grade conditions; that would give resources 1, 2, 3, and 4, when only 1 really should match. SELECT r.TITLE FROM resources r JOIN goals g ON (r.ID=g.RESOURCE_ID) WHERE g.SUBJECT = 'English' AND (g.GRADE = 1 OR g.GRADE = 2) GROUP BY r.TITLE HAVING COUNT(*) = 2; This can be generalized. Put the OR-separated list of grades to be matched in the WHERE clause, and change the row count in the HAVING clause to be the number of grades required. My real problem is slightly more complex, as the 'goals' table also contains an additional field which might be searched on. No problem. SELECT r.TITLE FROM resources r JOIN goals g ON (r.ID=g.RESOURCE_ID) WHERE g.SUBJECT = 'English' AND g.additional_field = 'whatever' AND (g.GRADE = 1 OR g.GRADE = 2) GROUP BY r.TITLE HAVING COUNT(*) = 2; I'm thinking it's time for me to go into the deep end of SQL (MySQL, actually), and my old O'Reilly MySQL mSQL book isn't doing the trick. Surely this has come up before - thanks for any guidance. - AM Thomas Michael -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: select where multiple joined records match
Except that he/she is using 4.0, which doesn't support subqueries. Michael Peter Brawley wrote: Have a look at the manual page for EXISTS, you appear to need something like SELECT * FROM resources AS r WHERE EXISTS ( SELECT resource_id FROM goals AS g WHERE g.resource_id = r.id AND grade=1 AND subject='English' ) AND EXISTS ( SELECT resource_id FROM goals AS g WHERE g.resource_id = r.id AND grade=2 AND subject'English' ) PB - AM Thomas wrote: I'm trying to figure out how to select all the records in one table which have multiple specified records in a second table. My MySQL is version 4.0.23a, if that makes a difference. Here's a simplified version of my problem. I have two tables, resources and goals. resources table: ID TITLE 1 civil war women 2 bunnies on the plain 3 North Carolina and WWII 4 geodesic domes goals table: ID RESOURCE_ID GRADE SUBJECT 1 11 English 2 11 Soc 3 12 English 4 21 English 5 23 Soc 6 32 English 7 41 English Now, how do I select all the resources which have 1st and 2nd grade English goals? If I just do: Select * from resources, goals where ((resources.ID = goals.RESOURCE_ID) and (SUBJECT=English) and ((GRADE=1) and (GRADE=2))); I'll get no results, since no record of the joined set will have more than one grade. I can't just put 'or' between the Grade conditions; that would give resources 1, 2, 3, and 4, when only 1 really should match. My real problem is slightly more complex, as the 'goals' table also contains an additional field which might be searched on. I'm thinking it's time for me to go into the deep end of SQL (MySQL, actually), and my old O'Reilly MySQL mSQL book isn't doing the trick. Surely this has come up before - thanks for any guidance. - AM Thomas -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Where's my ODBC icon?
I've checked Start Programs very thoroughly, and I can't find any reference to ODBC. That's what's so weird; I can see it in Add/Remove programs. I made a desktop shortcut icon to the system32/ODBCad file, but all it does is open up ODBC DataSource Administrator, which doesn't appear to be a start program. I uinstalled and reinstalled ODBC, hoping the start icon would register, but nothing changed. Thanks. --- Peter Brawley [EMAIL PROTECTED] wrote: David, I installed ODBC before but never got a chance to do much with it before my computer crashed. But I could have sworn there was a simple icon that I clicked to start it, just like a normal software program. My recollection is that ODBC installation normally adds ODBCAdmin to the Start Menu, so it's probably there somewhere, but if you want a desktop icon for ODBC Administrator, right click on it in Windows Explorer and select 'Create a Shortcut'. PB David Blomstrom wrote: --- Neculai Macarie [EMAIL PROTECTED] wrote: I just installed MySQL's ODBC program, but I can't figure out how to launch it. I see no reference to ODBC when I go to Start Programs. The only thing resembling an executable icon I can find is in my Add/Remove programs directory. I did a Windows search and found many files named ODBC, most of them in Windows/Prefetch and Windows/system32, but none of them appear to be executable programs. I posted a message on MySQL's ODBC forum but haven't received any replies. Does anyone know of a way to locate ODBC's executable file and create a desktop icon? I think the path is to configure ODBC datasources: %SystemRoot%\system32\odbcad32.exe There isn't a MySQL ODBC executable as far as I know. -- mack / OK, I found it there...but how do you start it? Double clicking it just brings up all sorts of information and choices. I installed ODBC before but never got a chance to do much with it before my computer crashed. But I could have sworn there was a simple icon that I clicked to start it, just like a normal software program. Thanks. __ Do you Yahoo!? The all-new My Yahoo! - What will yours do? http://my.yahoo.com -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 265.8.7 - Release Date: 2/10/2005 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Where's my ODBC icon?
The ODBC control applet in Windows can be found in two places:br 1. Control Panel. 2. Administrative Tools (if you are using Windows 2000 or XP).br If you have Windows 2000 or XP, the easiest way to find it is to find your Administrative Tools folder (usually you need to tweak the Start menu to make it visible) and double click on the Data Sources (ODBC) icon. If you have Windows XP you can also open control panel and use the Administrative Tools icon in there. If you don't have Windows 2000 or XP, you need to find a file called odbccp32.cpl (or similar). If this is placed in the windows\system directory it should be visible in Control Panel. If it is not visible, you should use TweakUI to enable it. TweakUI is a Microsoft utility and can be found by searching on download.com . Cheers Andrew. David Blomstrom wrote: I've checked Start Programs very thoroughly, and I can't find any reference to ODBC. That's what's so weird; I can see it in Add/Remove programs. I made a desktop shortcut icon to the system32/ODBCad file, but all it does is open up ODBC DataSource Administrator, which doesn't appear to be a start program. I uinstalled and reinstalled ODBC, hoping the start icon would register, but nothing changed. Thanks. --- Peter Brawley [EMAIL PROTECTED] wrote: David, I installed ODBC before but never got a chance to do much with it before my computer crashed. But I could have sworn there was a simple icon that I clicked to start it, just like a normal software program. My recollection is that ODBC installation normally adds ODBCAdmin to the Start Menu, so it's probably there somewhere, but if you want a desktop icon for ODBC Administrator, right click on it in Windows Explorer and select 'Create a Shortcut'. PB David Blomstrom wrote: --- Neculai Macarie [EMAIL PROTECTED] wrote: I just installed MySQL's ODBC program, but I can't figure out how to launch it. I see no reference to ODBC when I go to Start Programs. The only thing resembling an executable icon I can find is in my Add/Remove programs directory. I did a Windows search and found many files named ODBC, most of them in Windows/Prefetch and Windows/system32, but none of them appear to be executable programs. I posted a message on MySQL's ODBC forum but haven't received any replies. Does anyone know of a way to locate ODBC's executable file and create a desktop icon? I think the path is to configure ODBC datasources: %SystemRoot%\system32\odbcad32.exe There isn't a MySQL ODBC executable as far as I know. -- mack / OK, I found it there...but how do you start it? Double clicking it just brings up all sorts of information and choices. I installed ODBC before but never got a chance to do much with it before my computer crashed. But I could have sworn there was a simple icon that I clicked to start it, just like a normal software program. Thanks. __ Do you Yahoo!? The all-new My Yahoo! - What will yours do? http://my.yahoo.com -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 265.8.7 - Release Date: 2/10/2005 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- Andrew Pattison mail at apattison.plus.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Where's my ODBC icon?
--- Andrew Pattison [EMAIL PROTECTED] wrote: The ODBC control applet in Windows can be found in two places:br 1. Control Panel. 2. Administrative Tools (if you are using Windows 2000 or XP).br If you have Windows 2000 or XP, the easiest way to find it is to find your Administrative Tools folder (usually you need to tweak the Start menu to make it visible) and double click on the Data Sources (ODBC) icon. If you have Windows XP you can also open control panel and use the Administrative Tools icon in there. If you don't have Windows 2000 or XP, you need to find a file called odbccp32.cpl (or similar). If this is placed in the windows\system directory it should be visible in Control Panel. If it is not visible, you should use TweakUI to enable it. TweakUI is a Microsoft utility and can be found by searching on download.com . I have Windows XP, but I couldn't find an Administrative Tools folder, so I downloaded and installed TweakUI. I now have an Admin Tools folder on my desktop. I also located the file odbccp32.cpl in the Windows/system32 folder, so I'll try to figure out how to enable it. However, when I double-clicked odbccp32.cpl, I was rewarded with something similar to what I got before. I hope there's a user-friendly program waiting at the end of this journey! :) Thanks for all the tips. __ Do you Yahoo!? Yahoo! Mail - Find what you need with new enhanced search. http://info.mail.yahoo.com/mail_250 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Where's my ODBC icon?
However, when I double-clicked odbccp32.cpl, I was rewarded with something similar to what I got before. Not sure what you are looking for then. The myODBC driver should not need configuring, beyond setting up data sources, which is exactly what the control panel applet does for you. There is no program to launch - you configure a data source to allow you to access data, then use your ODBC-capable program to connect to that data source. Start up the ODBC applet and change to the System DSN tab. Next, add a new data source which uses the myODBC driver to connect to the database you want to access via ODBC. Once you have done this, you can then connect to the data source from your ODBC-capable program using the name of the data source. Cheers Andrew. David Blomstrom wrote: --- Andrew Pattison [EMAIL PROTECTED] wrote: The ODBC control applet in Windows can be found in two places:br 1. Control Panel. 2. Administrative Tools (if you are using Windows 2000 or XP).br If you have Windows 2000 or XP, the easiest way to find it is to find your Administrative Tools folder (usually you need to tweak the Start menu to make it visible) and double click on the Data Sources (ODBC) icon. If you have Windows XP you can also open control panel and use the Administrative Tools icon in there. If you don't have Windows 2000 or XP, you need to find a file called odbccp32.cpl (or similar). If this is placed in the windows\system directory it should be visible in Control Panel. If it is not visible, you should use TweakUI to enable it. TweakUI is a Microsoft utility and can be found by searching on download.com . I have Windows XP, but I couldn't find an Administrative Tools folder, so I downloaded and installed TweakUI. I now have an Admin Tools folder on my desktop. I also located the file odbccp32.cpl in the Windows/system32 folder, so I'll try to figure out how to enable it. However, when I double-clicked odbccp32.cpl, I was rewarded with something similar to what I got before. I hope there's a user-friendly program waiting at the end of this journey! :) Thanks for all the tips. __ Do you Yahoo!? Yahoo! Mail - Find what you need with new enhanced search. http://info.mail.yahoo.com/mail_250 -- Andrew Pattison mail at apattison.plus.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Where's my ODBC icon?
--- Andrew Pattison [EMAIL PROTECTED] wrote: However, when I double-clicked odbccp32.cpl, I was rewarded with something similar to what I got before. Not sure what you are looking for then. The myODBC driver should not need configuring, beyond setting up data sources, which is exactly what the control panel applet does for you. There is no program to launch - you configure a data source to allow you to access data, then use your ODBC-capable program to connect to that data source. Start up the ODBC applet and change to the System DSN tab. Next, add a new data source which uses the myODBC driver to connect to the database you want to access via ODBC. Once you have done this, you can then connect to the data source from your ODBC-capable program using the name of the data source. OK, now I understand it a little better. My ultimate goal is to extract some data from some GIS files and import them into MySQL. So it looks like I'm going to be using ODBC to connect a software program called GeoClient (which I haven't begun to figure out yet) to another program called ArcExplorer (which isn't working for me). This should be interesting. :) Thanks. __ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
A Heartfelt thank you.
I would just like to say thank you to everyone on the list who helped hunt down and find quirks while we coded up our latest software. We are absolutely thrilled with the resulting speed and power of our CMS software now. The ability to Optimize peoples websites while still keeping them dynamic is a huge leap in Search engine optimization. We are giving away the software for free if you would like to see the final result download a copy and please give us some comments from your perspective. http://www.firebasesoftware.com/firebase_downloads/FB-ReleaseVersion-1-1.zip Again you have been very helpful and I am sure we finally update our server to 4.1.8 we will be back with a boat load of questions. I know we are interested the sub search functionality of the new MySql. Thanks Donny Lairson President 29 GunMuse Lane P.O. box 166 Lakewood NM 88254 http://www.gunmuse.com 469 228 2183 -Original Message- From: David Blomstrom [mailto:[EMAIL PROTECTED] Sent: Sunday, February 13, 2005 3:18 PM To: mysql@lists.mysql.com Subject: Re: Where's my ODBC icon? --- Andrew Pattison [EMAIL PROTECTED] wrote: However, when I double-clicked odbccp32.cpl, I was rewarded with something similar to what I got before. Not sure what you are looking for then. The myODBC driver should not need configuring, beyond setting up data sources, which is exactly what the control panel applet does for you. There is no program to launch - you configure a data source to allow you to access data, then use your ODBC-capable program to connect to that data source. Start up the ODBC applet and change to the System DSN tab. Next, add a new data source which uses the myODBC driver to connect to the database you want to access via ODBC. Once you have done this, you can then connect to the data source from your ODBC-capable program using the name of the data source. OK, now I understand it a little better. My ultimate goal is to extract some data from some GIS files and import them into MySQL. So it looks like I'm going to be using ODBC to connect a software program called GeoClient (which I haven't begun to figure out yet) to another program called ArcExplorer (which isn't working for me). This should be interesting. :) Thanks. __ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: Where's my ODBC icon?
David: If you have windows XP go: Start/Control Panel in ther choose Administrative Tools and in there is Data Sources (ODBC) where you can define your dsn. Osvaldo Sommer -Original Message- From: David Blomstrom [mailto:[EMAIL PROTECTED] Sent: Sunday, February 13, 2005 12:46 PM To: mysql@lists.mysql.com Subject: Where's my ODBC icon? I just installed MySQL's ODBC program, but I can't figure out how to launch it. I see no reference to ODBC when I go to Start Programs. The only thing resembling an executable icon I can find is in my Add/Remove programs directory. I did a Windows search and found many files named ODBC, most of them in Windows/Prefetch and Windows/system32, but none of them appear to be executable programs. I posted a message on MySQL's ODBC forum but haven't received any replies. Does anyone know of a way to locate ODBC's executable file and create a desktop icon? Thanks. __ Do you Yahoo!? Yahoo! Mail - Find what you need with new enhanced search. http://info.mail.yahoo.com/mail_250 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 265.8.7 - Release Date: 2/10/2005 -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 265.8.7 - Release Date: 2/10/2005 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: Where's my ODBC icon?
--- Osvaldo Sommer [EMAIL PROTECTED] wrote: David: If you have windows XP go: Start/Control Panel in ther choose Administrative Tools and in there is Data Sources (ODBC) where you can define your dsn. I can't see Administrative Tools anywhere in my Control Panel, but I now have it on my desktop. It does contain a Data Sources (ODBC) icon, so I'll read up on the DSN function you mentioned. Thanks. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
more complexity (was: select where multiple joined records match)
Thank you kindly for your gracious help. I am making much progress (the 'as r' and 'as g' syntax is helpful; I'd forgotten about it since I'm doing most of this through Perl; thanks). I played with the COUNT solution for a while and was initially encouraged, nay, ecstatic. However, I was getting weird results and realized that I had left out a wrinkle in my example (and my thinking): the extra field in my goals table means that the other values can, as a group, be repeated for several rows. This seems to keep this solution from working. Mea culpa; my example wasn't adequate. There might be multiple records with a given subject and grade combination, due to the additional field (called GoalNumber) in the goals table. The combination of ResourceID, Subject, Grade, and GoalNumber will be unique, but the combination of ResourceID, Subject, and Grade need not be. Here's a revision of my example. resources table: ID TITLE 1 Got Your Nose 2 Goats and Waterfowl: A Promising Alliance 3 North Carolina and WWIIb 4 Geodesic Domes - Ivy Revolution goals table: (I know all the numbers make it hard to read, sorry; I'll try to improve readability by putting a blank line before a new RESOURCE_ID). ID RESOURCE_ID GRADE GOALNUMBER SUBJECT 1 11 1 English 2 11 2 English 3 11 3 English 4 11 1 Soc 5 12 5 English 6 12 6 English 7 12 1 English 8 12 2 English 9 21 1 English 10 23 1 Soc 11 32 1 English 12 32 7 English 13 32 9 English 14 41 1 English Now, if I understand how this is working: SELECT r.TITLE FROM resources r JOIN goals g ON (r.ID=g.RESOURCE_ID) WHERE g.SUBJECT = 'English' AND (g.GRADE = 1 OR g.GRADE = 2) GROUP BY r.ID HAVING COUNT(*) = 2; will give an incorrect result, because the number of rows returned for each matching ID will be unpredictable. It could be 7 rows for ID = 1 (which is a correct match), or 3 rows for ID = 3 (which shouldn't match since it only has grade 2). I wish the EXISTS solution offered by Mr. Brawley would work, but thanks to Mr. Stassen for the clue about MySQL version. I tried it anyway at the command line but, of course, it didn't work. I also found a reference to an INTERSECTION keyword and experimented with it briefly; I couldn't find a document that listed when certain features came into MySQL, so I don't know if INTERSECTION is completely out of the picture, though UNION seems to have arrived after 4.0. Is there such a document? Or do I have to look at the change log for each version? ( Running mysql -V actually gives me: Ver 12.22 Distrib 4.0.23a ) - AM Thomas -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Total Counts, Multi-Report Questions
Thanks for the ideas, Dan. I'm making progress! - Original Message - From: Dan Nelson [EMAIL PROTECTED] To: Sue Cram [EMAIL PROTECTED] Cc: mysql@lists.mysql.com Sent: Sunday, February 13, 2005 12:34 AM Subject: Re: Total Counts, Multi-Report Questions In the last episode (Feb 12), Sue Cram said: I have a request for a list of database entries Select x,y,z, etc that is now working OK. I have several questions, however. Here they are: 1.. Can I add a total line at the bottom of the report (ex: Total Selected: 23) for the total number of entries that are listed in the report? It's your report, you can put whatever you want in :) Simply print the size of the resultset of your main query, or if whatever language/reporting tool you're using can't do that, just do a SELECT COUNT(*) with the same WHERE clause. 2.. I want to print the same information but sorted in a different order on a second page of the report. Can I do that in one Select statement? If your language supports it, you can re-sort your resultset with a custom comparison fuction and display it again. Otherwise, you'll need another SELECT. 3.. If I need multiple select statements, is there a delimiter that says This is the end of my first select statement - the next thing you see is going to be a new select statement, so that all the necessary pages can be printed together in one job? So you want the same records to be returned in two orders, but as one resultset? Stick two queries together with a UNION ALL keyword. http://dev.mysql.com/doc/mysql/en/union.html -- Dan Nelson [EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]