PHP学习之SQL语句快速入门
2022-11-12 09:18:18
内容摘要
这篇文章主要为大家详细介绍了PHP学习之SQL语句快速入门,具有一定的参考价值,可以用来参考一下。
对此感兴趣的朋友,看看idc笔记做的技术笔记!Select * from tablenameSQL> sel
文章正文
这篇文章主要为大家详细介绍了PHP学习之SQL语句快速入门,具有一定的参考价值,可以用来参考一下。
对此感兴趣的朋友,看看idc笔记做的技术笔记!
Select * from tablenameSQL> select * from employees;Select select list from tablenameSQL> select employee_id,first_name from employees;Select distinct … from tablenameSQL> select distinct manager_id from employees;||连接符使用以及 加减乘除以及括号的使用SQL> select employee_id,first_name||'.'||last_name,salary*(1+0.1)/100,manager_id2 from employees;+-做正负号使用SQL> select -salary from employees;<>,>,<,=,!=等比较操作符SQL> select * from employees where salary >13000;SQL> select * from employees where salary <13000;SQL> select * from employees where salary <>13000;SQL> select * from employees where salary =13000;InSQL> select -salary from employees where employee_id in (100,101,102);SQL> select -salary from employees where employee_id in (select employee_id from employees);not inSQL> select -salary from employees where employee_id not in (100,101,102);Any(比任意一个都)select * from employees where employee_id >any(100,101,102);some 是 SQL-92 标准的 any 的等效物select * from employees where employee_id >any(100,101,102);all(比所有的都)select * from employees where employee_id >all(100,101,102);between andselect * from employees where employee_id between 100 and 102;not between andselect * from employees where employee_id not between 100 and 102;逻辑操作符And 和 orselect * from employees where employee_id > 100 and employee_id < 1000;select * from employees where employee_id > 100 or employee_id < 1000;Order byDescselect * from employees where employee_id between 100 and 102 order by employee_id desc;Ascselect * from employees where employee_id between 100 and 102 order by employee_id asc;dual哑元表没有表需要查询的时候可以用它select sysdate from dual;select 1*2*3*4*5 from dual;注:关于PHP学习之SQL语句快速入门的内容就先介绍到这里,更多相关文章的可以留意
代码注释