Categories:
.NET (961)
C (387)
C++ (185)
CSS (84)
DBA (8)
General (31)
HTML (48)
Java (641)
JavaScript (220)
JSP (109)
JUnit (31)
MySQL (297)
Networking (10)
Oracle (562)
Perl (48)
Perl (9)
PHP (259)
PL/SQL (140)
RSS (51)
Software QA (28)
SQL Server (5)
Struts (20)
Unix (2)
Windows (3)
XHTML (199)
XML (59)
Other Resources:
How To Create a New View
How To Create a New View? - MySQL FAQs - Understanding SQL CREATE, ALTER and DROP Statements
✍: FYIcenter.com
You can create a new view based on one or more existing tables by using the "CREATE VIEW viewName AS selectStatement" statement as shown in the following script:
mysql> CREATE TABLE comment (faqID INTEGER, message VARCHAR(256)); Query OK, 0 rows affected (0.45 sec) mysql> INSERT INTO comment VALUES (1, 'I like it'); Query OK, 1 row affected (0.00 sec) mysql> CREATE VIEW faqComment AS SELECT f.id, f.title, f.description, c.message FROM faq f, comment c WHERE f.id = c.faqID; Query OK, 0 rows affected (0.06 sec) mysql> SELECT * FROM faqComment; +----+-------------+-------------------------+-----------+ | id | title | description | message | +----+-------------+-------------------------+-----------+ | 1 | Learn MySQL | Visit dev.fyicenter.com | I like it | +----+-------------+-------------------------+-----------+ 1 row in set (0.07 sec)
2007-05-11, 4711👍, 0💬
Popular Posts:
What is Service Oriented architecture? “Services” are components which expose well defined interface...
Can you write a program to interchange 2 variables without using the third one? a = 7; b = 2; a = a ...
What are urlencode() and urldecode() functions in PHP? string urlencode(str) - Returns the URL encod...
Can you explain the fundamentals of “GetGlobalResourceObject ”and “GetLocalResourceObject” function...
interview.FYIcenter.com offers a collections of interview questions and answers for software and Web...