Questions tagged [querying]
516 questions
2
votes
0 answers
Graphql query to get an object nested in multiple layers
I am a graphql noob and the first query I have to write turned to be a complex one. Imagine this is the object I'm looking for
{
name : "ferrari"
year : "1995"
}
Now, there is a nested object in which this could be present, The object could…

Kiran
- 97
- 5
2
votes
1 answer
How to extract string after a marker?
I'm working on a project to perform a query into a set of files where the query criteria are inputted by a user.
Essentially, if the user inputs:
/T"some text"
The query will look for any file that contains "some text."
If a user inputs:
/T"some…

Nikita Albert
- 31
- 4
2
votes
1 answer
Recieving an Unknown column 'users_personals.user_id' in 'where clause' on my sql query
I don't know why this is happening as they all exist:
SELECT (
SELECT COUNT(user_id)
FROM users u
WHERE
u.id=users_personals.user_id
AND u.status NOT IN (1,2,7)
LIMIT 1
) as Total
FROM users_personals p
WHERE
…

JohnnyRingo506
- 25
- 6
2
votes
2 answers
Simplify query to make TIMESTAMP column
I have a table with columns of 'year', 'month', 'day', 'hour' and 'minute' separately.
All columns INTEGER except 'month' (VARCHAR) and I added a new column to put everything together, 'date_time'…

Pedro Muñoz Zubía
- 39
- 4
2
votes
1 answer
Querying a many-to-many collection or how to include a many-to-many table in a criteria query?
I am quite new to the world of NHibernate and I can't seem to get this to work with the use of a criteria query: query a many-to-many relationship or query a collection (set/bag) on an entity. I've searched the internet and checked all the…

TedOnTheNet
- 1,082
- 1
- 8
- 23
2
votes
2 answers
counting all string values in given column of a table and grouping it based on third column
I have three columns. the table looks like this:
ID. names tag
1. john. 1
2. sam 0
3. sam,robin. 1
4. robin. 1
Id: type integer
Names: type string
Tag: type integer (just 0,1)
What I want is to find how many times…

Kathan Vyas
- 355
- 3
- 16
2
votes
1 answer
Typeorm: Check if a property is either value 1, 2, 3 or n
I want to get all tasks that have a certain role. I have an array of strings for which I want to get the tasks.
Query:
return this.createQueryBuilder('task')
.select(this.baseSelect)
.where('task.role = :role', { role }) // What here?
…

sandrooco
- 8,016
- 9
- 48
- 86
2
votes
1 answer
Levenshtein Distance for a List of Thousands of Similar Entries of Cryptocurrencies
I have a list of over a thousand different cryptocurrencies alphabetized. The issue is here if a user queries for, say, "BTC" they will get BTCA (Bitair) out of the list, since THAT comes before Bitcoin. Alternatively, typing Bitcoin will give you…

Devin Rowan
- 135
- 8
2
votes
1 answer
Querying github project cards with graphql
I have a Project in Github with some columns, and I'm trying to locate cards (Issues) that are in the closed state.
With GraphQL I'm having trouble constructing a query that can filter the cards. Currently I have this query:
query {
…

berto
- 8,215
- 4
- 25
- 21
2
votes
2 answers
Database Querying -- Better to count number of rows or better to keep an increment counter?
If you were implementing a blog application - what would you prefer -
Having a counter in the "POSTS" table storing the number of comments
SELECT comment_count
FROM posts WHERE post_id = $id
...or counting the number of comments for a…

Sussagittikasusa
- 2,525
- 9
- 33
- 47
2
votes
1 answer
Query for a specific child of a parent in SQLAlchemy
I'm trying to write a query that will return exactly one child object from a parent.
My model is as follows:
class Parent (Base):
__tablename__ = 'parents'
id = Column(Integer, primary_key=True)
name = Column(String)
children_id =…

evan
- 73
- 8
2
votes
3 answers
Searching for numbers/product codes in Solr
I have a text-field to which i'm feeding normal text that contains product codes (e.g. FI302010, RR220011, etc).
I would like to be able to search for these product numbers.
I have tried it out in the ANALYSIS-tool - And here it looks like it…

Svenn
- 111
- 2
- 5
2
votes
1 answer
Finding a user profile match in laravel 5.3
I have a user who speaks native language lets say English and wants to learn French.
How can I find a list of match where users native is French and wants to learn English.
Its a language exchange program so I would like to list users with the…

Murlidhar Fichadia
- 2,589
- 6
- 43
- 93
2
votes
1 answer
Swift 3 and Firebase: Retrieve auto id value from snapshot
I created the structure below on firebase and I need to get the auto id underlined in red:
The code I created to query the values:
let query = reference.queryOrdered(byChild: "receiverId").queryEqual(toValue: "LKupL7KYiedpr6uEizdCapezJ6i2")
…

Enzo
- 73
- 2
- 9
2
votes
0 answers
Android Firebase query without event
I want to retrieve a user from Firebase.
public User findByUserName(String username){
Query query = this.mDatabaseReference.orderByChild("username").equalTo(username);
query.addListenerForSingleValueEvent(new ValueEventListener() {
…

Teodor Dimitrov
- 1,003
- 2
- 12
- 19