SQL conditional union

前端 未结 1 1920
谎友^
谎友^ 2021-02-12 22:00

Question: I have an SQL function which returns a list of files

now I should join an additional list to that list with an union, but only if the user is admin.

Is

相关标签:
1条回答
  • 2021-02-12 22:59
    SELECT  *
    FROM    table1
    UNION ALL
    SELECT  *
    FROM    table2
    WHERE   @isAdmin = 1
    
    0 讨论(0)
提交回复
热议问题