Most voted "query" questions
Query or *query* refers to the act of recovering data previously stored in a computerised system from certain parameters and/or filters, by means of a specific command or operator.
Learn more…1,160 questions
Sort by count of
-
0
votes1
answer97
viewsQuery firebase field returning null
I am searching for the field (value) in the table (revenue) in the firebase database, but when performing the debug I get the following: V/InputMethodManager: Starting input:…
-
0
votes0
answers32
viewsReturn all results in a grouped query even if the sum is zero or null
I have the following consultation grouped: SELECT SUM(SUC.PESO), EXTRACT(DAY FROM HU.FIM), CASE WHEN (ACO.COLUNA_2 IN ('L','C') AND HU.ESP_MM_UNMET<=3) THEN 'Carb' WHEN (ACO.COLUNA_2 IN ('L','C')…
-
0
votes1
answer36
viewsFormatted date range - return of between
I am doing a select of a range of dates, however, when I do the formatted is returning data that should not return, in case, more months and less months... Follows interval and query. SELECT id,…
-
0
votes1
answer118
viewsReturn of JSON column from the bank in Golang
I am creating a function to return the data of a query that involves SELECT, however there is a column that stores a JSON, and in return comes a number structure, someone could explain to me what…
-
0
votes1
answer49
viewsLIKE with strange behavior in MYSQL
I have the following query SELECT p.nome_completo, p.id_pessoa, curr.link_video, prof.nome as nome_profissao, fav.id_favorito as fav_id FROM candidato as cand INNER JOIN pessoa as p on (p.id_pessoa…
-
0
votes1
answer123
viewsPOSTGRES: INNER JOIN 1:N with multiple tables. Need to count and display records that were accessed as a list
I need to count table records acesso_registro and show in a list. Schema: acesso_registro +--------------+--------+------------+ |id_tipo_midia |id_midia| data_acesso|…
-
0
votes2
answers37
viewsError summing using Join and sub-query - MYSQL
Good afternoon, I have two tables that I need to perform the sum but it is grouping. *Correction: The rule of business is that there are notes , in which the user can make several deposits upon the…
-
0
votes0
answers43
viewsHow to list the number of open records and which were served in the same sql?
I need to get the number of open calls and the number of open calls that have been answered, all grouped by month. I’m trying like this: select T_aberto.mes, T_aberto.qtd_aberto,…
-
0
votes1
answer205
viewsQuery sql to search for and a string equal to but larger than the one stored in the table
I have a table that stores screen urls from my system, I wanted to perform a query that returns me a url that comes parameterized as follows /avaliacoes-cozinha-segura/avalia-cozinha/2 to that url…
-
0
votes1
answer103
viewsCreate a Wordpress Query using ACF Relational Fields
good night. I’m developing a movie registration website for a movie-aficionado cousin and need a help to put a query that lists the names of the films whose page personality participated or acted. I…
-
0
votes2
answers519
viewsSQL Query average time DO NOT take into account Weekends and holidays
I need to average the time it takes since creation (a. Date of creation) until completion (s. Data_status_finalized) field. Not able to count weekends and holidays. The following query is working,…
-
0
votes2
answers104
viewsConvert a Query with a Subquery to a Query with a Join
I’m trying to optimize a Query that the system I’m working on makes it have a SubQuery inside, only this SubQuery is referencing another table that has relation to the main table and by what I’ve…
-
0
votes0
answers53
viewsError inserting data in table with column of the numeric type VB NET
Hello, I am having problems when trying to insert data in an SQL database through VB.NET. I’m migrating some vb6 projects to . net, I came across the first problem I spent the day trying to solve…
-
0
votes1
answer548
viewsHow do ORDER BY DESC work in Mysql?
I am trying to make a query on my table using OREDER BY DESC, even using the correct syntax I get the error: "You have an error in your SQL syntax; check the manual that Corresponds to your Mysql…
-
0
votes0
answers411
viewsQuery with like and or with PHP variable
I have a form with two inputs one type text and one type date. I am trying to make a query where the result should be filtered either by name field or by birth date field or by two together. It…
-
0
votes1
answer650
viewsConsultation with eloquent relationship
I am hitting myself here with a simple query on Laravel, I want to make a query on the client table and bring the customer’s address together. Note: Whenever I try it brings the address id and not…
-
0
votes1
answer65
viewsI need to make a query in the database. mysql
I have the following database. CREATE TABLE IF NOT EXISTS futebol ( id INT PRIMARY KEY AUTO_INCREMENT, nome VARCHAR(30) NOT NULL, estado VARCHAR(2) NOT NULL, brasileirao INT NOT NULL, copadobrasil…
-
0
votes1
answer124
viewsQuery to bring 1 parent record and in it can contain multiple children records (performance)
Supposing for the client I can add more joins as not only sales, and the result of this consultation bring much more records. This is a performative way of working or would be better to query each…
-
0
votes4
answers114
viewsDoubt QUERY SQL construction
I have two TB1 and TB2 tables with equal fields in order to compare the records. The logic is: Query the records contained in TB1, but not contained TB2, considering 3 fields: code, date and value.…
-
0
votes2
answers44
viewsHOW TO ADD UP THE VALUE OF A PRO CLIENT COLUMN
Good afternoon Gentlemen, In benefit of my studies I am developing a simple sales system and I am already in the part of the reports. My doubt is as follows: How to make a select adding up the…
-
0
votes1
answer55
viewsSalesforce Query Returning Wrong Date
In Salesforce when I run the following query SELECT Data_de_Nascimento__c FROM Account WHERE id = '0013K00000ABC' he returns me 1999-05-29 In Java, after I set up the integration, I run this…
-
0
votes1
answer80
viewsHow to use two database columns as a sort criteria for a Query?
Hello, Could you help me with this question? I’m making a query in MYSQL you need to search the records database and sort them by two different columns using ORDER BY. I’m using the query following,…
-
0
votes1
answer49
viewsgroup_contact using left Join mysql and separator
Good afternoon, folks. I’m having a question how to mount a query using group_concat. I have 2 tables: Prova ID Name Respostas_ID Status 1 Teste 1 1,2 1 2 Teste 2 2,4,5 1 3 Teste 3 4,5 0 On the…
-
0
votes1
answer47
viewsPWA - How to pass parameters to another page while offiline?
I am developing a PWA application that will work mainly in offiline mode, I have created and implemented virtually everything, indexedDB, service-worker, etc... I am trying to pass some parameters…
-
0
votes1
answer87
viewsI need the GROUP BY clause read after HAVING
My problem is the following, the distance is the crucial information for my research, and I need to use also GROUP by not to appear several equal products! Then as the group by comes before the…
-
0
votes2
answers108
viewsDoubt Python with Firebird database query
Hello I have a problem with the Firebird database query. I make the connection with the bank and step this query, but the problem is in return, it returns the name of the normal product only that…
-
0
votes1
answer89
viewsRun SQL Query multiple times between two dates (MYSQL)
I wonder how I do to run an SQL query between two dates where for example: the user will choose two dates: starting date = 20/04/2020 final date = 25/04/2020 so I wanted to know how do I do to do…
-
0
votes0
answers199
viewsValidate Cpf’s of an sql query
Good afternoon people, I have the code below to validate Cpf and cnpj However, when trying to call the sql function, it does not execute because of the following error: [Code: 6552, SQL State:…
-
0
votes0
answers50
views -
0
votes1
answer36
viewsPercentage of each value within a table field. The field stores two values, 1 for yes and 2 for No
I’m trying to develop a customer satisfaction survey application where the user answers some questions with numbers 1 to 10 and another yes or no. In one of the reports, I show the average of each…
-
0
votes2
answers295
viewsPerform SQL query with two foreign keys from the same table?
I’m creating a recognition system for the company and it was almost over, it’s been some time that I’m trying to carry out this consultation but not getting. I have the following tables:…
-
0
votes1
answer43
viewsProblem with SQL return
I have the following 3 tables: Clients, Requests, Requests: Customers: Solicitations: requeca_description The request table links to the client table(cliente_id = id[client table]) and linked to the…
-
0
votes1
answer250
viewsMysql extract from INPUT and OUTPUT tables
I’m a beginner in Mysql and PHP, I’m building a financial management application for a charity, (volunteer work), and I can’t solve this problem: Performing a Mysql query in the IN and OUT tables…
-
0
votes1
answer37
viewsHow to obtain an element that is within two or more elements?
I am using the method querySelector to obtain an element that is within three elements of <div> as in the code below: <div class="main"> <div> <div> <span>Elemento…
-
0
votes1
answer181
views.find() from Mongoose returns nothing when it should
I’m trying to make an appointment with Mongodb with Mongoose. The parameter is a $in with an array whose only value is a regular expression that selects the object if the attribute "url" has the…
-
0
votes1
answer282
viewsHow to make a cumulative sum in Bigquery?
Hello. I need to create a Dashboard from a query. I would like to generate this column in the query always adding up to the previous month, ie a cumulative sum. ex: instead of: mês 1: 2 mês 2: 3 mês…
-
0
votes1
answer39
viewsError inserting data in mysql and php
I’m kind of a beginner dealing with php and would like some help to understand why this is happening I am having the following problem, when I run the following php Function, it does not return…
-
0
votes1
answer115
viewscount amount of records in recent months
I have 3 aircraft tables, occurrence and aeronave_occurrence, I need to know if the same aircraft was present in any event in the last 2 months of the data_utc back, and how many aircraft were…
-
0
votes3
answers258
viewsHow to search for an element with querySelector filtering through innerText?
I’d like to know how I can through querySelector (or any other function) to obtain one or more elements (<div>, <a>, <button>, ...), filtering through the content of innerText. In…
-
0
votes1
answer52
views -
0
votes0
answers27
viewsSQL Query Clicking on the image that brings the selected color inside the input
I updated the server: the form has stopped working. The image fires an onclick, which switches the image on the form slide (this works); and informs the id/value of the selected color, which goes…
-
0
votes0
answers140
viewsCall to a Member Function result() on bool
I’m trying to get results from a Stored Procedure in the CodeIgniter, in the bank brings the result normally but in the CodeIgniter brings that mistake: in my model is like this: public function…
-
0
votes1
answer63
viewsHow to select from 2 id to bring Different Name
I’m having trouble making a SELECT on Postgres, as follows. Tabela -> Pessoa In this table, are stored data of Customers, suppliers, Exporters, Manufacturer, There is no table for each type of…
-
0
votes1
answer36
viewsSQL - doubt in query
I have the following appointment to do, I was able to think of them separately. I’m starting to study databases and I don’t know how to relate the two. Table Occurrence number, date, description,…
-
0
votes1
answer39
viewsgroup each period per month
I’m doing this consultation, but I’m not able to group each period per month, the previous year. For each month of the year preceding the current year, return the amount of parked cars per period…
-
0
votes1
answer73
viewsDoubt with LEFT or INNER JOIN and WHERE SQL Access
all right? So, I have this query here in Access: SELECT tbl_produtos.NomeProduto, tbl_produtos.PrecoVenda, tbl_precos_especiais.PrecoVenda FROM tbl_produtos LEFT JOIN tbl_precos_especiais ON…
-
0
votes0
answers83
viewsMysql file export error "ERROR 1(HY000): Can’t create/write to file"
Hello, I was having some problems to export a table in csv format from my database in Mysql due to the definitions of "secure_file_priv"... I made the following changes: I created a directory at the…
-
0
votes0
answers37
viewsHow to use group by to group similar results for the same table record?
I have a database with the tables: contract, broker, buyer, seller, product and harvest. In this relationship, a contract will have only 1 relationship with the tables product and harvest, 1 or more…
-
0
votes0
answers19
viewsSpecific filtering with Mysql
Hello, my friends. I have a mysql database, and I’m making some appointments I want to know how I can do a very specific filtering. For example, I have a database:…
-
0
votes1
answer56
viewsHow to query Data values on a C# connection to excel using Oledb?
Follow below the line of code private void button7_Click(object sender, EventArgs e) { string conex = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + textBox1.Text + ";Extended Properties=\"Excel…