#12002/4/9 11:29:01
-------------- 查询嵌套的用法 -------------------------------
select name
form aaa
where id >100
Update bbb
set name='#name#'
------------------- 数据查询中的多重判断 -------------------------------
select * from 表名 where 0=0
and parkname like '%#parkname#%'
and parktype = '#parktype#'
and state = '#state#'
---------------- 数据查询中的视图建立和访问 -----------------------
数据查询中的视图建立
create view vget_applicants as
select 'applicant name'as name,
'''best quality''mentioned in interview' as quality,
'does back' as back_end
from 表名
数据查询中的视图访问
select name,quality,back_end from vget_applicants
----------------- 数据查询中的子查询 -------------------------------
select name from 表名 where id in
(select id from 表名2 where name like '%#name#%')
------------------- 数据查询中的合计函数 -------------------------------------
select count(字段名) as name
min(age) as min_age
max(age) as min_age
avg(age) as min_age
from 表名 where 字段名=条件
-------------------- 数据查询中的列别名 ------------------------------
select 字段名 as name from 表名
#name#
以上内容是一些简单的查询方法,请熟练掌握。