Convert askterisk (*) to a list column names customerName, firstName, lastName, phone, which corresponds to customerName, contactFirstName, contactLastName, phone.ĬustomerName LIKE '%Co%' Code language: SQL (Structured Query Language) ( sql ) TEMPTABLE.Convert view name contactPersons to table name customers.WHERE customerName LIKE '%Co%' Code language: SQL (Structured Query Language) ( sql ) Suppose that you issue the following statement: SELECT * FROM contactPersons The following statement creates a view based on the customers table with the name contactPersons with the MERGE algorithm: CREATE ALGORITHM= MERGE VIEW contactPersons(įROM customers Code language: SQL (Structured Query Language) ( sql ) See the following customers from the sample database: Note that the combination of input query and the SELECT statement of the view definition into a single query is referred to as view resolution. Then, execute the combined query to return the result set.First, merge the input query with the SELECT statement in the view definition into a single query.When you query from a MERGE view, MySQL processes the following steps: Here is the CREATE VIEW statement with the ALGORITHM clause: CREATE VIEWĪS select- statement Code language: SQL (Structured Query Language) ( sql ) MERGE The CREATE VIEW and ALTER VIEW statements have an optional clause: ALGORITHM. The algorithm determines how MySQL process a view and can take one of three values MERGE, TEMPTABLE, and UNDEFINE. Summary: in this tutorial, you will learn about MySQL view processing algorithms including MERGE, TEMPTABLE, and UNDEFINED.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |