代码之家  ›  专栏  ›  技术社区  ›  vignesh

从sql server中的查询获取元数据

  •  0
  • vignesh  · 技术社区  · 6 年前

    示例查询

      select a.Col1 ,b.col2 ,case when a.col3 = 'abc' then b.col4 else a.col5 end 
      from tablea A
      join tableb B on a.col6 = b.col7
      where a.col8 = '123'
    

    所需输出:

    Tables  Column  usage
    TableA  Col1    select
    TableB  Col2    select
    TableA  Col3    select
    TableB  Col4    select
    TableA  Col5    select
    TableA  Col6    Join
    TableB  Col7    join
    TableA  Col8    where
    
    0 回复  |  直到 6 年前