枫叶落
Mysql查询表中数据(select from)
2014-7-10 Eagle
select from命令用来查询表中的数据。



1) 查询所有行

命令格式: select <字段1, 字段2, ...> from < 表名 > where < 表达式 >;



例如,查看表 MyClass 中所有数据:

   mysql> select * from MyClass;



2) 查询前几行数据

例如,查看表 MyClass 中前2行数据:

    mysql> select * from MyClass order by id limit 0,2;



select一般配合where使用,以查询更精确更复杂的数据。
发表评论:
昵称

邮件地址 (选填)

个人主页 (选填)

内容