sql简单查询语句
Use Dogif
--查找user2表的UserName列--
select UserName FROM User2
--查找user2表的UserName列中不相同的值--
select DISTINCT UserName FROM User2
--查找user2表的PassWord列中不相同的值--
select distinct password from user2
//where查询
select *from user2 where username=‘admin‘
select *from user2 where ID=1
//and 查询
select * from user2 where Username=‘test‘ and password=123456
//or查询
select *from user2 where username=‘test‘or password=‘123456‘
//and和or结合查询
select *from user2 where (Username=‘test‘ and password=123456) or username=‘admin‘
//order by以xxx为排序查找 以字母进行排序
select username,password from user2 order by username
//rder by以xxx为排序查找 以字母.数字进行排序