--SQL查询每个表的字段数量select b.[name], count(*) As AllCount,ISNULL(ISNULL(sum(case when isnullable=0 then 1 end),null),null) as NotNullCountfrom syscolumns aINNER JOIN( select [id], [name] from [sysobjects] where [type] = 'u' ) AS b ON a.id = b.[id] GROUP b…
dictionary 全部数据字典表的名称和解释,它有一个同义词dict,dict_column 全部数据字典表里字段名称和解释 如果我们想查询跟索引有关的数据字典时,可以用下面这条SQL语句: select * from dictionary where instr(comments,'index')>0;如果我们想知道user_indexes表各字段名称的详细含义,可以用下面这条SQL语句: select column_name,comments from dict_columns wher…
--例如: id NAME VALUE 1 a pp 2 a pp 3 b iii 4 b pp 5 b pp 6 c pp 7 c pp 8 c iii --id是主键 --要求得到这样的结果 id NAME VALUE 1 a pp 3 b iii 4 b pp 6 c pp 8 c iii --方法1 DELETE YourTable WHERE [id] NOT IN (SELECT MAX([id]) FROM YourTable GROUP BY (NAME + VALUE)) --…