T-Sql表查询

select * from sales
 where payterms='ON invoice'


select top 2 qty from sales where payterms='net 60'

select * from sales order by qty

select * from sales where payterms='net 60' order by qty

select stor_id,sum(qty) from sales group by stor_id

select * from sales where ord_num like 'p3%'

select royalty from titles where royalty is not null


select advance from titles where advance>7000

select type,avg(price) as '平均值'from titles group by type

select title_id,max(royaltyper) as '最大值' from titleauthor where au_id like '[^8]%8%' group by title_id

select * from sales where ord_date between '1993' and '1994' order by title_id desc

select top 40 percent * from sales 


select count (地区) as '供应商总数',地区 from 供应商 group by 地区

select 供应商ID,传真 from 供应商 where 传真 is not null

select 产品名称,单价*订购量 as '总价' from 产品

select top 10 *,运货费 from 订单 order by 运货费 desc

select 货主名称,货主地址,货主城市,货主邮政编码 from 订单 where 货主名称 like '方%'

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值