我正在尝试让以下 SQL 与 llblgen 一起使用...
SELECT *,(SELECT TOP (1) Id FROM Content.Grades WHERE Account = Authentication.Account.Id ORDER BY Grades.GradingDate DESC) AS CurrentGrade FROM Authentication.Account WHERE (SELECT TOP (1) Grade FROM Content.Grades WHERE Account = Authentication.Account.Id ORDER BY Grades.GradingDate DESC) = 5
var dtFields = new ResultsetFields(1);
dtFields.DefineField(GradesFields.Id, 0);
var dtDefinition = new DerivedTableDefinition(
dtFields, "c", new PredicateExpression(GradesFields.Grade == SelectedGrade.Value));
// specify the relation which is a dynamic relation.
var relation = new DynamicRelation(dtDefinition, JoinHint.Inner,
EntityType.GradesEntity, "o",
(new EntityField2(AccountFields.Id.ToString(), "c", typeof(string)) ==
GradesFields.Account.SetObjectAlias("o")));
RelationBucket.Relations.Add(relation);
我正在努力让它适应,因为每次我尝试查询时我都会在现场遇到错误......