http://www.informit.com/articles/article.aspx?p=377653&seqNum=8
ALL, ANY, and SOME Subqueries The ALL and ANY operators are used in conjunction with a relative comparison operator to test the result of a column subquery. However, for statements that modify tables (INSERT, REPLACE, DELETE, UPDATE) there is currently a restriction that the subquery cannot refer to the table being modified
mysql - How can an SQL query return data from multiple tables - Stack Overflow
http://stackoverflow.com/questions/12475850/how-can-an-sql-query-return-data-from-multiple-tables
There is a limit which depends on your database, but short of recursive functions of some insane and maniacal programmer, most folks will never hit that limit. Some databases will allow a full outer join which will bring back results (whether matched or not) from both tables, but this isn't supported in all databases
MySQL :: MySQL 5.1 Reference Manual :: 13.2.5.1 INSERT ... SELECT Syntax
http://dev.mysql.com/doc/refman/5.1/en/insert-select.html
To avoid ambiguous column reference problems when the SELECT and the INSERT refer to the same table, provide a unique alias for each table used in the SELECT part, and qualify column names in that part with the appropriate alias. This means that, when using replication, there is no guarantee that such a SELECT returns rows in the same order on the master and the slave; this can lead to inconsistencies between them
http://www.informit.com/articles/article.aspx?p=30875&seqNum=5
On the other hand, you may find it alarming to consider that you could wind up thinking in terms like that!) Many of the examples that demonstrate how to use the forms of join operations that MySQL supports use the following two tables, t1 and t2. ; DROP TABLE tmp; If you want to run a UNION-type query on MyISAM tables that have identical structure, you may be able to set up a MERGE table and query that as a workaround for lack of UNION
MySQL :: MySQL 5.0 Reference Manual :: 13.2.8 SELECT Syntax
http://dev.mysql.com/doc/refman/5.0/en/select.html
If you use FOR UPDATE with a storage engine that uses page or row locks, rows examined by the query are write-locked until the end of the current transaction. For example, in the following statement, columnb is treated as an alias name: SELECT columna columnb FROM mytable; For this reason, it is good practice to be in the habit of using AS explicitly when specifying column aliases
No comments:
Post a Comment