I want to get only the first rows of every partition in Azure Tables. I can get all the data and then use the solution in this answer on that result. What I am asking is "Can I do that on Azure side without getting all that unnecessary results?"
Asked
Active
Viewed 1,852 times
2
-
Do you know the PartitionKey values of the table that you wish to query? – Gaurav Mantri Aug 15 '16 at 13:00
-
@GauravMantri I will write a condition based on partition key. That will filter out many records. After that part, what i do not want is getting, say 50, entities per partition key as I only need the first one (ordered by row key) for each partition key. – Nuri Tasdemir Aug 15 '16 at 13:05
-
@GauravMantri I do not have any information on row key. I just know that I want the one with min row key for each partition key (for the partition keys satisfying the condition). – Nuri Tasdemir Aug 15 '16 at 13:08
-
@GauravMantri Currently I am eliminating the rows other than the MIN row on the server side(c#) instead of AzureTables side – Nuri Tasdemir Aug 15 '16 at 13:11
-
I edited the question. Filtering on partition key is not related to what I am asking. – Nuri Tasdemir Aug 15 '16 at 13:24
-
Is the row key a number? – Tony Basallo Aug 17 '16 at 13:55
-
@TonyBasallo In my case it is a number (stored as a string). However I have to remind that PartitionKey and RowKey are strings in AzureTable. – Nuri Tasdemir Aug 17 '16 at 14:28
1 Answers
2
Simple answer to your question is that without knowing the PartitionKey
in advance, such operation is not possible from the Azure Table side. If you know the PartitionKey
values, you can query on that value (RowKey
is not required) and then get single result by specifying $top=1
(Take(1)
in LINQ) as one of the querystring parameter.

Gaurav Mantri
- 128,066
- 12
- 206
- 241