表查询期间的筛选字符串如下所示.
string FilterString = string.Format("PartitionKey eq '{0}'
and RowKey ge '{1}' and RowKey le '{2}'",
partitionKey, startsWith, startsWith);https://msdn.microsoft.com/library/azure/dd894031.aspx说你可以对名字做前缀匹配。假设有三个名字..。
当我将startsWith设置为's‘时,我希望查询同时返回超人和蜘蛛侠。
当我说上面的查询起作用时
RowKey ge 's' and Rowkey le 't'不过,我希望它能奏效,因为它说.
RowKey ge 's' and Rowkey le 's'le被视为、lt、和IMHO --它不应该这样做。我做错了什么吗?
发布于 2015-06-26 06:18:19
如果您想要返回superman和spiderman (不确定DC & Marvel Comics如何同意这一点,但这是另一个故事:),那么您要发出的查询是:
RowKey ge 's' and Rowkey lt 't'现在让我们考虑一下这个查询:
RowKey ge 's' and Rowkey le 's'基本上,此查询将只返回RowKey eq s中的数据。要举一个例子,请考虑superman。现在,superman肯定大于s,所以您的第一个表达式(RowKey ge 's')是true,但同时,第二个表达式(Rowkey le 's')是false,所以整个表达式的结果将是false。
更新
要测试字符串,只需编写一个控制台应用程序,如下所示:
string a = "s";
string b = "superman";
string c = "sz";
Console.WriteLine(b.CompareTo(a));//Prints 1
Console.WriteLine(b.CompareTo(c));//Prints -1从上面可以看出,superman大于s,小于sz。
https://stackoverflow.com/questions/31065444
复制相似问题