2

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?"

7
  • Do you know the PartitionKey values of the table that you wish to query? Aug 15, 2016 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. Aug 15, 2016 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). Aug 15, 2016 at 13:08
  • @GauravMantri Currently I am eliminating the rows other than the MIN row on the server side(c#) instead of AzureTables side Aug 15, 2016 at 13:11
  • I edited the question. Filtering on partition key is not related to what I am asking. Aug 15, 2016 at 13:24

1 Answer 1

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.

2
  • 1
    And how about a sample of the code to do just that? Nov 30, 2018 at 20:15
  • 3
    Back here again, and I would still like a code sample... :) Oct 10, 2019 at 3:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.