我有以下 LINQ 查询:
From metasect In DirectCast(Form.ChildDocBox.Tag, META_DOCUMENT).META_SECTIONS
From metaset In metasect.META_SETS
From metacell In metaset.META_CELLS
From lookup In metacell.CHILD_META_CELL_CELLS_LOOKUPS
Where lookup.PARENT_META_CELL_META_CELL.META_SET.META_SECTION.META_DOCUMENT.META_DOC_ID = docToDelete.META_DOC_ID
Select metasect.META_SECT_NAME + " gets from " + lookup.PARENT_META_CELL_META_CELL.META_SET.META_SECTION.META_SECT_NAME Distinct
Select指令选择一个可以重复的表达式,因为在同一对父子元节有多个查找,这就是我添加 Distinct子句的原因。
现在,我想计算每个父母/子女夫妇有多少查找。
就像是
SELECT metasect.META_SECT_NAME + " gets from " + lookup.PARENT_META_CELL_META_CELL.META_SET.META_SECTION.META_SECT_NAME,
COUNT(lookup)
FROM ...
WHERE ...
GROUP BY metasect.META_SECT_NAME + " gets from " + lookup.PARENT_META_CELL_META_CELL.META_SET.META_SECTION.META_SECT_NAME
提前感谢您的任何建议:)