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
-
-1
votes3
answers72
viewsCode reduction in sql query
I created a query with the following objective: Select all the tools which the inventories theirs nay are gifts in all businesses. One Tool has one or more stocks, a stockpile belongs to only one…
-
-1
votes2
answers70
viewsSQL + Medium Query
Gentlemen, I have an appointment that makes the calculation by line. The result is in the field calculo_diff. Calculation is the difference DataHoraTerno,as shown below: Now I need to make an…
-
-1
votes1
answer198
viewsSub query between two mysql tables, for each row a set
It is the following I have a table in mysql in which it keeps the name of the students and in this same table it has a column that keeps the code of the class in which the student is enrolled, I…
-
-1
votes1
answer832
viewsDate query in python calendar?
I’ve been studying python for just over a week, but I’d like to perform a more action or bros as follows. will be placed the monetary value and places the day of closing the card and the day of…
-
-1
votes3
answers750
viewsSQL Inner Join 3 tables
Good afternoon. I want to make an Internet but the result does not come out. Tabela1 = rec Campo = chvbfj(3) <- codigo do cliente Tabela1 = rec Campo = doc(3,4,5) <- lista de codigos de itens…
-
-1
votes2
answers158
viewsSELECT COUNT with low performance in mysql
I use a query within PHP to display the list of related categories and subcategories, get back more than 10,000 results (right) in 3 seconds on average, but after I implemented a subquery to check…
-
-1
votes2
answers228
viewsTwo tables without relationship filter - Laravel
I’m having trouble filtering with two different models. The problem is that there is no relationship between the tables. That’s right =/ The modeling was done by someone else, who said that it would…
-
-1
votes1
answer354
views -
-1
votes2
answers377
viewsFetch stock balance on a given day (or day)
I have the table "saldo_dia" where I record the product (ID), the date and the balance. I need to generate a report (Kardex) and fetch the balance of a given day as "starting balance". My question…
-
-1
votes1
answer383
viewsAccumulated balance with multiple accounts - SQL
I’m having trouble creating an account statement that has the option to filter all accounts and/or only a few accounts. I am using this SQL to appear these record this way select bancos.id,…
-
-1
votes2
answers89
viewsCan you help me optimize this SQL query?
I am having a problem with this sql query. Its return time is on average 10 seconds and ta using 100% cpu. Probably because it uses many subquery. However I’m not able to optimize it. Does anyone…
-
-1
votes2
answers46
viewsQuery help for the problem created?
I need to create a list composed by the fields Current and Next Stage both stage names coming from the same table. Example of the result I seek: Stage Table (stage name provider) The query searches…
-
-1
votes1
answer123
viewsQuery mysql on Node-JS Not Working
I am developing a Node application in which I need to do some query’s in mysql, however a simple query of select is not working. follows the code of the passage function processTag(tagNumber,…
-
-1
votes1
answer57
viewsHelp with a Ruby on Rails query
Good afternoon, I just started working with Rails and I’m having trouble with a query. I’m building an Api where I have the Game model and the User model. A user has several games, and one game has…
-
-1
votes1
answer408
viewsHow to take an array within another array using python
I am trying to pick up an array of coordinates within another array in JSON document format, but am having difficulties. This is the JSON document I’m using { "bairro": "Vila Mariana", "type":…
-
-1
votes1
answer28
viewsProblem with SQL return
I have a table that connects two other tables. "Request" it links "Customers" and "Solitation_description" It has the cliente_id link columns and request_descricao_id, I need to return clients who…
-
-1
votes1
answer39
viewsHow to perform this query correctly ? [Mysql]
In front of this database: Employee(employee, employee name, street, city) Works(employee, code company, salary) Company(code company, company name, city) Manager(employee,…
-
-1
votes1
answer30
viewsPull only user items
Talk personal, I have 1 database and data with 2 tables so far the first table is responsible for registering the users with the name "users", the other table is where I want to register the events…
-
-1
votes1
answer31
viewsStrategy for big queries
I’m working on an application that features a map and needs to render hundreds of thousands of markers. The data for rendering is in the database and the query is costly. There is also the challenge…
-
-1
votes2
answers34
viewsSub-consumption With Different Aggregate Results
Good afternoon, everyone, I have two queries that work perfectly separate, but need to display in a grid information of the two queries. I need to take all the inputs of a product and put in a…
-
-1
votes1
answer21
viewsYou can do a PIVOT using SUBSTR
Hello everybody all good? I’m trying to do a PIVOT on oracle 11 by only getting the first character of a STRING. CREATE TABLE T_ESTOQUE( CD_ENDERECO VARCHAR(15), CD_PRODUTO VARCHAR(20), QT_ESTOQUE…
-
-1
votes1
answer33
viewsSUBSELECT - POSSIBILITY OF IMPROVEMENT
I would like some guidance on a query. It is working, but the current script generates a very high reading demand in the bank due to a case comparing a table data, with another through a subselect…
-
-1
votes1
answer30
viewsQuery in different columns at the same time in Mysql
I have two tables, the first doesn’t matter for now, the second follows example below and we will name from table2: id column1 column2 1 valor1 value2 2 value2 valor1 3 Valor3 value4 4 value5 value6…
-
-1
votes0
answers29
viewsSQL, as always bring a value in a query even though the query is null
I have the following select, in it I bring the point of operation on day 1, and the subquery brings the point of dia2. SELECT id_Ponto, (SELECT id_Ponto FROM ponto WHERE cancelado = false AND…
-
-1
votes0
answers23
viewsQuery exceeding server limit, but in the local is ok, Orange
I wonder if you have how to optimize this query, not have to change server for now. $enterprisesIds = Survey::select('survey_enterprise.enterprise_id') ->join('survey_enterprise',…
-
-1
votes0
answers7
viewsHelp to build a query in Mysql - Build a query between two tables, each table is in a different database
Gentlemen good afternoon I am a junior programmer, and I came across a situation in the company , which I can not solve , what happens , we need to compare two values , but each value is in a…
-
-2
votes1
answer277
viewsQuery of date check
I have a normal query: select * from TABELAS Where (AlvaraNumero <> '0') and ( AlvaraValidade <> '0000-00-00' ) and ( AlvaraAnexo is NOT Null ) and ( AcidenteNumero <> '0') and (…
queryasked 10 years, 6 months ago ChrisAdler 1 -
-2
votes1
answer153
viewsHibernate libraries with JPA specification
I am using JPA and Hibernate and encountering difficulties regarding querys errors. I wonder if there is a specific JPQL library? and what are necessary for projects to sound this profile.
-
-2
votes1
answer256
viewsThe more queries in Mysql the higher the consumption?
I’m developing a website and my code is using many queries/queries in Mysql at once, I’m trying to decrease these queries to the smallest number since I think the more queries more resources will be…
-
-2
votes1
answer444
views -
-2
votes1
answer1420
viewsShow Mysql query result with Echo (PHP)
I have a script in PHP and Mysql that has a query responsible for counting how many records (clients) are inserted in one of the tables of my database. However, I need to show the amount of records…
-
-2
votes1
answer65
viewsDatabase query with java
I will make a comparison with my problem using a database functionality and html Jquery. With Jquery we have the possibility to visit the database and bring the data to the frontend in HTML, and…
-
-2
votes2
answers581
viewsHow to pass python variable to sql query?
I am using Mysql as a database. I wanted to be able to pass the value of a python variable as a parameter in this query. Ex: cursor = connection.cursor() variavel_nome_cliente = input('Digite aqui o…
-
-2
votes1
answer120
viewsSubconsulta returns more than one value
Good night! I have an sql query based on a CTE and I want to take the largest value between a subconsulta, but when I run the main query the subconsulta error returns more than one value appears.…
-
-2
votes1
answer25
views -
-2
votes1
answer65
views0097 - missing parentheses on the right. - Can help
I know you already have some negotiations here in the forum about this error 0097 - missing parentheses to the right.. This is my command, you can help me ? select distinct Coalesce(Sum(Case When…
-
-2
votes2
answers91
views -
-2
votes1
answer43
viewsSlow query performance
I have a database that has about 3 teras and I’m having problems optimizing some querys. In this example I have 3 tables: Automaker, Car and model. And I have this query that takes about 30m, all…
-
-2
votes1
answer45
viewsQUERY SQL SERVER QUERY
I have a question how to proceed in this case, where I have a query that would need the nserie was ignored or showed only the 1 item of that SELECT ped.codfil, i.seqipd, i.codpro, p.codref,…
-
-2
votes1
answer102
viewsLIKE for timestampz sequelize
I am trying to filter the activities by date but the field is timestampz. The bank I am using is the postgres { "name": "SequelizeDatabaseError", "parent": { "name": "error", "length": 220,…
javascript node.js query sequelize-js operator-likeasked 4 years, 8 months ago Gabriel Guizardi Cardoso 1 -
-2
votes1
answer128
viewsQuery data in a txt file with python Tkinter
I’m creating a simple system to query employee data stored in a file txt. def read_from_file(): with open('dados.txt') as file: for line in file: line = line.rstrip('\n') nome, matricula,…
-
-2
votes1
answer113
viewsHow to catch two tables without joining them with Zend1.12 query Builder?
Based on documentation of Zend 1.12, using the Builder query: How I select two tables with comma only without joinInner: Example: SELECT TABELA1 FROM ( BLABLABLA... ) A, (SELECT TABELA2) B To…
-
-2
votes1
answer265
views"foreach" inside query using PHP PDO " $sql = $Pdo->prepare( )"
Good morning everyone, I’m trying to create a runtime view. For this I need to list all the fields of the table and play within the statement the problem is that I can’t transfer the $obj1[0] array…
-
-2
votes2
answers49
viewsHOW TO TREAT EMPTY VALUES IN SEVERAL COLUMNS?
I have a TB that has 15 telephone columns, where several rows are empty. I need to turn these 15 columns into only one. Using UNION ALL and putting a condition in WHERE to get rid of the empty…
-
-2
votes1
answer26
viewsMYSQL query date range and any other date in the same query
I have the following dates as an example: 2021-06-01 2021-06-02 2021-06-03 2021-06-04 2021-06-05 would like to display 2021-06-01, 2021-06-02, 2021-06-03 and 2021-06-05 I am trying to do it this…
-
-2
votes0
answers43
viewsQuery of SQL Count
In a certain algorithm routine, the following data is recorded in a table: Color Changed Led (Are two possible leds, code 2 to yellow, 3 to red) Reason for the Change (These are pre-defined reasons…
-
-3
votes3
answers220
viewsShow query (Problem Different Id’s)
I have a query a little big but then when I ask to show it comes with mixed id’s. I have something wrong in the query? SELECT * FROM tb_detalhe_trabalhador1 inner join tb_empresa on…
-
-3
votes1
answer64
viewsHow to retrieve specific information within this array?
I made a query SQL in the Wordpress database that returned me all the information related to a request, but I need to store some variables of this information and do not know how to do. The $pid…
-
-3
votes1
answer328
viewsConsult children objects that satisfy condition in parent objects, Relationship with eloquent
I have in my project two tables that relate, but I would like to make a query Consult that brings all children entities that a field is equal to parent entity, being for all parent entities that…
-
-3
votes1
answer40
views