I wanted to query multiple selective tickets on ADO in a single line any suggestions
I am expecting to query in a single line like 2810, 2910
Use operator 'In' to query multiple items
Related
I am trying to run complex query for Azure Table where I want to count number of rows for all deviceID for specific dateiot and timeiot? Is this possible?
Your query would be something like:
PartitionKey eq 'aaaa' and dateiot eq 'bbbb' and deviceID eq 'cccc' and timeiot eq 'dddd'
2 things though:
This query will do a complete partition scan and may result in incomplete data in a single request. Your code should be able to handle continuation tokens to get all data matching the query.
Table query does not support count functionality so you will get the entities back. You will need to add all entities to get the total count of entities matching the query.
I'm trying to query cosmosDB where would like to search the first name with SQL 'like' feature, also for case insensitivity i'm using cosmos DBs' 'lower' function.
e.g. SELECT * FROM c where contains (lower(c.lastName), "abc")) // Request Charge = 1660+
I observed Request Charge for this query is around 1660+ but when I use normal query without 'Contains' and 'lower' function the Request Charge is just '8'
e.g. SELECT * FROM c where c.lastName = "abc" // Request Charge = 8
Please help to understand what's causing the huge difference in Request Charge?
The first query with contains is effectively doing a freetext search and will have to scan all documents.
The second query is using an exact match and thus will just use an index and cost less.
And to besides the cost of the actual query path the result set of the first query could be much greater than the second as the second is always contained within the first but the first could match many more, e.g. abcd, cabcd.
If you're looking to search across a lot of text columns then it is worth looking at one of two options.
If you are searching for whole words and the columns are not too
long then you could tokenize the columns into matching fields
The more robust option would be to look at using Azure search in
combination with Cosmos DB
This advice is from the azure blog
I have a select query in a JCL. For eg: the select query will fetch 130 rows with 6 columns. I need to pass the values of each row one by one to a REXX using the JCL. Is there a way to do it? Any help would be appreciated.
how to get doc frequency of multiple fields in single query. If we query with name and address. it should return docfrequency of name index and lat_long index based on the inquiry.
As far as I know, you can't do it in a single query. Why not multiple queries, but not retrieving the full document when you don't need it (so it's faster).
if i have to pass a list of numbers got from one select statement to another select statement both working on the same collection, how will I be able to perform that ?
Query:
SELECT VALUE student.studentId
FROM student
where student.acctType="student"
This gives me a result:
["1","2","3","4"]
The query, if I had those values
SELECT student.firstName,
student.lastName
from student
where student.acctType="student" AND
student.studentId IN ("1","2","3","4")
This is what I tried but did not work :
SELECT student.firstName,
student.lastName
from student
where student.acctType="student" AND
student.studentId IN ( SELECT VALUE student1.studentId
FROM student1
where student1.acctType="student")
DocumentDB has an SQL-familiar query syntax but it's still a NoSQL database. As such, it has no support for inter-document joins and no support for sub-queries. That's the bad news.
The good news is that DocumentDB allows you to write stored procedures (sprocs) to accomplish everything you could with full SQL and much much more. You could write a sproc that did the query that returned the list of numbers, then use that list of numbers to compose another query to get your the data you need.
That said, for the simple use case you describe, you could accomplish the same thing client-side with two round trips.