TAILIEUCHUNG - Beginning PHP and MySQL From Novice to Professional phần 8

, một số thông tin về người dùng ghé thăm. Bộ điều khiển này được hiển thị trong Ví dụ 24-3. Ví dụ 24-3. Các điều khiển AboutController nhưng bạn không muốn MySQL để làm bất cứ điều gì cho đến khi bạn đã hoàn tất văn bản thông thường được lưu trữ. | T22 CHAPTER 28 MYSQL STORAGE ENGINES AND DATATYPES Copying a Table It s a trivial task to create a new table based on an existing one. The following query produces an exact copy of the employees table naming it employees2 CREATE TABLE employees2 SELECT FROM employees An identical table employees2 will be added to the database. Sometimes you might be interested in creating a table based on just a few columns found in a preexisting table. You can do so by simply specifying the columns within the CREATE SELECT statement CREATE TABLE employees3 SELECT firstname lastname FROM employees Creating a Temporary Table Sometimes it s useful to create tables that will have a lifetime that is only as long as the current session. For example you might need to perform several queries on a subset of a particularly large table. Rather than repeatedly run those queries against the entire table you can create a temporary table for that subset and then run the queries against it instead. This is accomplished by using the TEMPORARY keyword in conjunction with the CREATE TABLE statement CREATE TEMPORARY TABLE emp_temp SELECT firstname lastname FROM employees Temporary tables are created just as any other table would be except that they re stored in the operating system s designated temporary directory typically tmp or usr tmp on Linux. You can override this default by setting MySQL s TMPDIR environment variable. Note As of MySQL ownership of the CREATE TEMPORARY TABLE privilege is required in order to create temporary tables. See Chapter 29 for more details about MySQL s privilege system. Viewing a Database s Available Tables You can view a list of the tables made available to a database with the SHOW TABLES statement mysql SHOW TABLES CHAPTER 28 MYSQL STORAGE ENGINES AND DATATYPES 723 ------------------------------- Tables_in_company ------------------------------- employees ------------------------------- 1 row in set sec Note that this is the standard methodology prior to .

TÀI LIỆU MỚI ĐĂNG
8    193    0    22-05-2024
10    171    0    22-05-2024
15    194    0    22-05-2024
75    145    0    22-05-2024
1    124    1    22-05-2024
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.