Update question
I'm not quite sure why I haven't run across this in the past, but now that I have I am stumped. I am needing to update a table based on criteria found in it and one other table, but I am uncertain how to proceed. If I had subselects I would run the query as follows, I believe: UPDATE suppliercatlink SET suppliercatlink.catid=124 WHERE suppliercatlink.supid IN (SELECT supplier.id FROM supplier WHERE supplier.company_name LIKE %exteri%) AND suppliercatlink.catid=10 ; Knowing that this is not an option I figure maybe I could join the tables in my UPDATE statement like: UPDATE suppliercatlink, supplier SET suppliercatlink.catid=124 WHERE supplier.company_name LIKE '%brick%' AND supplier.id=suppliercatlink.supid AND suppliercatlink.catid=10 ; Looking at the documentation it appears this will not work, at least not with 3.23 which I am currently running. It appears that something of this nature would work if I upgraded to 4.0.4, but I really prefer to update mySQL before or after a project, not right in the middle of it. Can anyone help me figure out a way around this problem? Jay Drake [EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: MySQL tutorials, users passwords, interface.
Could anybody: 1) Recomend a good book which covers the basics of MySQL, /or any good tutorials on the web? The mysql documentation is very good, I use http://www.mysql.com/doc/en/index.html as my home page, but you really have to know what to look for in order to find it. It's been so long since I've looked for a good starting out tutorial to figure out how to use mySQL that I regret to say I don't have any idea on that. Although, that said, following the mySQL documentation from the beginning chapter by chapter has alot of very good information for getting started. 2) Tell me how to set up usernames and passwords for MySQL. Hmm... start here. http://www.mysql.com/doc/en/Default_privileges.html This will have you setup your main (root) user, from there you may want to check out granting and revoking priveleges. (http://www.mysql.com/doc/en/GRANT.html) 3) Recomend an easy to use interface for MySQL (can I use phpMyAdmin if I'm not using PHP?). phpMyAdmin is great, but it certainly requires that you have php installed and running. (Although this doesn't mean you have to use php for anything else.) One windows program that I've used in the past and tends to get reasonably good reviews is mySQLFront available from http://www.anse.de/mysqlfront/. I generally don't recommend using GUI tools for anything that a person doesn't understand. They are easier to use, but that also makes it easier to really screw things up also. JayD - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Query problem
Hey all, I've been given the task of adding a few hundred, and later a few thousand, new records to my database that currently exist in (ugh...) an excel spreadsheet. I was able to very quickly and efficiently deal with the initial insertion of the main data to the main table, but am having difficulty figuring out how to get the related information into the related table. Now, if that didn't make any sense, here's exactly what I'm trying to do: I have a table named suppliers which has, among other things, a column named ID, which is likely to be the only important column for this issue. This is the table that was easy to populate. I also have a second table called suppliercatlink which holds 3 columns as ID, SUPID, CATID. SUPID in this table relates to ID in the supplier table. ID in this table autoincrements. What I need to do is insert into suppliercatlink SUPID,CATID values(supplier.ID,123) where supplier.id 100 and supplier.id 200. the CATID will be the same for all of these entries, the only thing that will vary is the supplier.ID, and the CATID should (theoretically) autoincrement. I'm sure there is a relatively simple way to deal with this, but for the moment I am about as lost on how to properly deal with this. (And in fact feel that I could probably have added the CATID to the spreadsheet and included it in the initial sql statement somehow, but don't want to get that complicated... yet.) Thanks for the help! Jason Drake [EMAIL PROTECTED] query mysql - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php