access数据库sql语句
时间: 2023-09-24 18:10:31 浏览: 122
以下是一些常见的 Access 数据库 SQL 语句:
1. 创建表:
CREATE TABLE table_name (
column1 datatype,
column2 datatype,
column3 datatype,
....
);
2. 插入数据:
INSERT INTO table_name (column1, column2, column3, ...) VALUES (value1, value2, value3, ...);
3. 更新数据:
UPDATE table_name SET column1 = value1, column2 = value2, ... WHERE condition;
4. 删除数据:
DELETE FROM table_name WHERE condition;
5. 查询数据:
SELECT column1, column2, ... FROM table_name WHERE condition;
6. 连接表:
SELECT column_name(s) FROM table1 INNER JOIN table2 ON table1.column_name = table2.column_name;
7. 分组数据:
SELECT column_name, COUNT(*) FROM table_name GROUP BY column_name;
8. 排序数据:
SELECT column1, column2, ... FROM table_name ORDER BY column1 ASC/DESC;
9. 创建索引:
CREATE INDEX index_name ON table_name (column_name);
以上仅为一些常见的 SQL 语句示例,Access 数据库还支持其他更多的语句和功能。
阅读全文