作业帮 > 英语 > 作业

帮我解释下这个查询语句@

来源:学生作业帮 编辑:百度作业网作业帮 分类:英语作业 时间:2024/05/02 11:11:38
帮我解释下这个查询语句@
select c_id,c_gcode,c_number into #11 from tb_bill_rg where c_id in(select c_id from tb_bill_r where datediff(day,c_au_time,'2007-04-01')=0 and c_ad_from like '2%') and c_gcode not in(select c_gcode from tb_d_sum_gds
where c_number_move>0 and datediff(day,c_dt,'2007-04-01')=0 and c_adno like '2%')
order by c_gcode
select #11.c_id,#11.c_gcode,#11.c_number,tb_gds.c_name from #11,tb_gds where #11.c_gcode=tb_gds.c_gcode
order by #11.c_gcode
有很多地方不明白,请逐步细致的帮我解释哈
特别像#11,这个代表什么?
帮我解释下这个查询语句@
select c_id,c_gcode,c_number into #11 from tb_bill_rg 的意思是:在tb_bill_rg 表中查询c_id,c_gcode,c_number字段写入#11表中相应字段.
where c_id in(select c_id from tb_bill_r where datediff(day,c_au_time,'2007-04-01')=0 and c_ad_from like '2%') and c_gcode not in(select c_gcode from tb_d_sum_gds
where c_number_move>0 and datediff(day,c_dt,'2007-04-01')=0 and c_adno like '2%')
这些是查询条件.
这个的意思是tb_bill_rg 表中c_id字段等于tb_bill_r表中c_au_time字段在2007年4月1日之后并在2007年5月20日之前并且c_ad_from字段为‘2’开头的记录中的c_id字段并且c_gacode字段不包含于tb_d_sum_gds表中c_number_move大于零并且c_dt字段在2007-4-1之后和2007-5-20之后的记录并且c_adno以‘2’开头.
order by c_gcode
这个是以c_gcode升序排序.
select #11.c_id,#11.c_gcode,#11.c_number,tb_gds.c_name from #11,tb_gds where #11.c_gcode=tb_gds.c_gcode
order by #11.c_gcode
查询表#11,tb_gds中的#11.c_id,#11.c_gcode,#11.c_number,tb_gds.c_name字段其中#11表的c_gcode等于tb_gds表的_gcode
以#11表中c_gcode字段排序.