Sub W() ' MsgBox "行数:" & Selection.Rows.Count Dim rows_count As Integer Dim rows_id As Integer Dim column_count As Integer column_count = Selection.Columns.Count '获取选择区域的列数 'MsgBox column_count '打印列数 rows_id = ActiveCell.
django获取指定列的数据 model一般都是有多个属性的,但是很多时候我们又只需要查询特定的某一个,这个时候可以用到values和values_list [values()](https://docs.djangoproject.com/en/1.9/ref/models/querysets/#values) values()¶ values(*fields)¶ Returns a QuerySet that returns dictionaries, rather than model i
如下表: 表名:Test ID RowID Col1 Col2 1 1 A A 2 1 B A 3 1 A B 4 1 C B 1,查找表中字段重复的只查找一次 select distinct Col1 from Test ; select Col1 from Test where ID in(select min(ID) from Test group by Col1 ); 结果为: A B C 2,统计并查询该字段出现的数量 SELECT Col1,COUNT(Col1) FROM Tes