小编Bar*_*rny的帖子

通过联合使用不同的顺序

我想写一个像这样的查询

    select top 10 * from A
    order by price
    union
    select top 3 * from A 
    order by price
Run Code Online (Sandbox Code Playgroud)

或者......那样的

    select top 10 * from A
    where name like '%smt%'
    order by price
    union
    select top 3 * from A
    where name not like '%smt%'
    order by price 
Run Code Online (Sandbox Code Playgroud)

你能帮我么?

sql t-sql sql-server

9
推荐指数
1
解决办法
2万
查看次数

标签 统计

sql ×1

sql-server ×1

t-sql ×1