摘要:
declare @num1 int --为符合条件的总行数 select @num1=COUNT(1) from cardInfo where openDate between @date1 and @date2 --@date1 和 @date2 为开始时间到结束时间,可以理解一个条件 while 阅读全文
摘要:
查询book表中大于该类图书价格平均值的图书信息 先将第一条记录的类编号的值为2代入子查询中,子查询为 select avg(price) from book b where b.id=2 则得到类编号为2的书籍平均价格为(23+45)/2=34 再和外部查询做判断 select * from bo 阅读全文