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
votes0
answers67
viewsSimple National The Controltovalidate Property of ''Regularexpressionvalidator1'' cannot be Blank
I am developing a query in Simple National, but when giving an Httppost on the site http://www8.receita.fazenda.gov.br/simplesnacional/aplicacoes/atbhe/consultaoptantes.app/consultaropcao.aspx gives…
-
0
votes1
answer47
viewsMultiple Bags Exception / Searching multiple collections with JPA
I’m having a problem with JPA when I make an appointment. I’d like to consult Entity A that has a List of Entity B and List of Entity C (I want to consult Entity A bringing the relationships with…
-
0
votes2
answers186
viewstype’T' must be a Reference type in order to use it as Parameter 'Tentity' in the Generic type or method
When trying to make a query using Iqueryable, I get the following error: Error 3 The type’T' must be a Reference type in order to use it as Parameter 'Tentity' in the Generic type or method…
-
0
votes2
answers137
viewsVery slow python code?? Access to Access database with pyodbc
I need to get some data from a huge access database (two, actually, depending on the input I have). I have a function that calls this bank by Chunks (if I try a fetchall gives memory problem). This…
-
0
votes2
answers77
viewsHelp Query Sum
I’m trying to retrieve a column and make a sum - using the SUM - according to the time zone, but without success. You can help me with this issue? Detail: I’m not using exactly a table, but perform…
-
0
votes2
answers113
viewsHow could I improve this SQL query query with sub querys?
There are many sub selects, how could improve this query in Mysql and make a max SUM of total_points_period'? Pick up the total points for a period from the "user_bigdata" table and the total points…
-
0
votes1
answer58
viewsResult of the come zeroed query
Good Afternoon, I have a question, could you help me? ... What happens is: I have an sql query that brings me the total amount of sms sent per month and year, but I would like when I had not worked…
-
0
votes1
answer38
viewsError with relationship - Laravel
Guys, I’m with 2 related tables and I want to show you 1 dice that has a just "pulling" this relationship. tables: Users: Permissions: Table that will list: Code: @foreach(App\User::all() as $user)…
-
0
votes2
answers901
viewsHow to use Multiple select in PHP form to query in MYSQL
I have a search with a select that can select more than one option, but I don’t know how to make them search all the selected options. Currently it does the search, inserts the values in the url (I…
-
0
votes2
answers729
viewsPower BI - Oracle SQL Query
Hello, I am trying to get data in Power BI via Query on an Oracle DB and is showing the following error. Cannot establish connection Details: "Oracle: ORA-01843: not a Valid Month" SELECT DISTINCT…
-
0
votes1
answer68
viewsHelp with Join in Mysql
I found several questions/answers about John on the site, but I still can’t create the command I need. What I need is the following: I have the following tables: item (I have two entries) id…
-
0
votes1
answer271
viewsCan you create a rule in MYSQL to divide the value of one column by another?
I want to know the average of the values (value m2) in a table using AVG() (or otherwise). I have a table in MYSQL with the columns id, total value (Total value), value m2 (Value per m²) and area.…
-
0
votes1
answer44
viewsReturn row count of a query
I’m trying to validate a login using line count of a query, but I’m not getting it: My connection is like this: include("defines.php"); try { $PDO = new PDO('mysql:host=' . HOST . ';dbname=' . DB,…
-
0
votes1
answer110
viewsProblems with the return of the query in Laravel 5
Hello, I’m having trouble with my Laravel research function class PesquisaController extends Controller { public function pesquisaMonitoramento(Request $request, Monitoramento $mot) { $mot =…
-
0
votes2
answers72
viewsShow first and last record of each date
I would like to search the database for all records according to the "DOCTOR" between two dates DATA_INICIAL and DATA_FINAL No repeat records of the day. CURRENT RESULT: BRUNO BARBOSAS 02/04/2018…
-
0
votes1
answer138
viewsPass variable in UPDATE PDO PHPERRO: Pdostatement::execute(): SQLSTATE[HY093]
@$c_matricula = $_POST['numero']; @$data_aa = $_POST['data_aa']; @$data_ff = $_POST['data_ff']; if(isset($data_aa)){ @$dataa = date("Y-m-d H:i:s"); $pdo = $dbconn->prepare("UPDATE contato SET…
-
0
votes0
answers189
viewsHow to display the result of a search in mysql where returns more than 10mil result without crashing the browser?
I am currently using the table jquery to display the results, but it takes a long time to display all the results and while the search is not finished the browser sometimes hangs. has some better…
-
0
votes1
answer144
viewsSearch with date in Laravel
Devs, good afternoon I’m having the following problem, I have the sequinte query I’m running with DB::raw() From Laravel, I need the date to be passed to query as a string with simple quotes only so…
-
0
votes0
answers534
viewsQuery error - Inconsistent NCLOB data
Hello, I am trying to perform a query in an Oracle database and is returning an error ORA-00932: inconsistent data types: expected - obtained NCLOB 00932. 00000 - "inconsistent datatypes: expected…
-
0
votes1
answer52
viewsQuery does not return values
None of my querys return values, since they have data in my database. What could be happening in my code that is resulting in this? Follows the Code: <?php require_once("Usuario.php");…
-
0
votes1
answer41
viewsHow to insert a keyword into a database search already performed
For example, I did a search of all user data in the database to echo in different columns by the site: $stmt = $conexao->prepare("SELECT * FROM esc_usuarios WHERE usu_codigo = ?");…
-
0
votes1
answer44
viewsBring data from range
I would like to bring even those where there was value in the consultation For example; table dice id | valor | data 1 | 5 | 01/10/2018 2 | 6 | 03/10/2018 3 | 7 | 04/10/2018 5 | 8 | 05/10/2018 I’d…
-
0
votes1
answer46
viewsLink in computer table that submits a field to a plug
Good morning, you guys, I have a table, which is a query select of the data of the devices I control. In it I have several elements, such as Name, Macaddress and IP, for example. In the IP column, I…
-
0
votes2
answers158
viewsSum of fields completed within the SELECT itself
I have an SQL query in the following format: SELECT XXXX AS duracao, calcula_horas_manutencao({data_inicio_f}, {data_final}, contrato.id) as horas_manutencao,…
-
0
votes1
answer259
viewsHow to perform a recursive query with the relations stored in a JSON array?
I have a MYSQL table that relates to itself. The relations are represented in the same table through a JSON Array. Here is the table and some sample data: CREATE TABLE `templatedata` ( `Id`…
-
0
votes1
answer30
viewsHelp with logic UPDATE using queries
It’s the following guys, I have two tables, the table esc_usuarios which contains information from registered users and esc_usuarios_slog, that contains the records of the casualties, in which they…
-
0
votes0
answers51
viewsQuery in mysql grouped by hour
Good afternoon. I am performing a query in mysql and this returns the precise values. My problem is to display the values that do not return by e.g.: I asked to group by hour or day it only returns…
-
0
votes3
answers721
viewsSelect Distinct is bringing duplicate Mysql data
I need to bring only the last record of each id_face that has in the table imagens, but for some reason it’s bringing id_faces duplicates. Follow my consultation: SELECT DISTINCT(i.id_face) as…
-
0
votes3
answers91
viewsHelp with SQL query with COUNT in multiple rows
Hello, I’m doing the following consultation SELECT p.id, c.nome, v.titulo, count(v.titulo) FROM passageiros AS p LEFT JOIN clientes AS c ON c.id = p.id_cliente LEFT JOIN viagens AS v ON v.id =…
-
0
votes2
answers82
viewsDatabase returning no value
I have the following code: $sql="SELECT * FROM imoveis WHERE (suite LIKE '%".$suites."%' OR banheiro LIKE '%".$banheiro."%' OR quarto LIKE '%".$quarto."%' OR garagem LIKE '%".$garagens."%') AND…
-
0
votes0
answers392
viewsError Query Oracle
People, when executing the query below, the following error is occurring. By parsing, the error occurs when I put sum. For what reason? "ORA-00918: column defined ambiguously 00918. 00000 - "column…
-
0
votes1
answer42
viewswp_query returning the entire post. Returns only title
I have this code and when I put it on the Home Page it returns the entire post. I need you to return only the title, date and thumbmail of the post, is recovering all content of the post... function…
-
0
votes0
answers163
viewsDifferent Value - Oracle Query
In the query below in the column Valor_Total_da_Ordem is giving a totally different value, far above what was actually to be. The value is giving 55990.62. The correct value being 1333.11. What may…
-
0
votes0
answers38
viewsDoubt Query Line - Oracle
In the query below is leaving this way. Unidade Ordem_Compra CNPJ Aprovador Sim Boavista 29021 155454878787 Ivan Sim Boavista 29021 155454878787 Romel The question is: How do I leave on a line just…
-
0
votes3
answers210
viewsHow to use Bootstrap4 Timeline in PHP
I am trying to use Bootstrap4 Timeline but am having problems working with database. The Bootstrap Timeline is displayed alternately, that is, a record is positioned on the left, and the next on the…
-
0
votes0
answers119
viewsAdd counter - Postgresql
I have the following Query: SELECT array_to_string(array_agg('"'||public.lotesretornosuprimento.codigoestoque||'"'), ', ') as codigos, est.codigosuprimento, public.suprimento.suprimento, ( select…
-
0
votes1
answer424
viewsEXCEL - Query list and return values
I have a database with the following information: I need to represent this information in graphic, and the need arose to create a query to search the values according to the selected week and month.…
-
0
votes0
answers41
viewsChecking array value and adding corresponding css class
I am developing an odontogram and in the registration form which tooth or teeth will be made the treatment. These choices are recorded in a column and a flag 0 in another column relating that that…
-
0
votes1
answer794
viewsSQL Server Row Number Counter
how do I perform a counter on the sql server from a certain number. Example below. Current result Ticket Ação 42977 1 42977 2 Expected result 42977 3 42977 4 42977 5 ---Below the query--- The first…
-
0
votes1
answer33
viewsSelect help in two columns
I have the following select command: SELECT pa_coduni, pa_proc_id, sum(case when substr(pa_cmp, 1, 4) = 2017 then pa_qtdapr else 0 end) a2017, sum(case when substr(pa_cmp, 1, 4) = 2018 then…
-
0
votes1
answer122
viewsList posts related by category in wordpress
When opening a blog post, I need to pick up all posts, ordered by descending date, that have the same label and are in the same state of the open post. This is OK. I need to filter more, the…
-
0
votes2
answers198
viewsConditional help in SQL WHERE
Come on, guys, I’m putting together an SQL query. In this query, the field SD1010.D1_TES can assume N values, but if this field is equal to empty, I need one more restriction to be applied…
-
0
votes1
answer177
viewssub-query with main query parameter
I have this query: SELECT id_arquivo, nome_arquivo, etapa, em_uso, em_uso_por, processo_concluido, obs_temp_etapa_atual, cod_funcionario_dev, status_devolucao, devolvido_por,…
-
0
votes1
answer275
viewsQuery search android studio, firebase data listing problems
Could someone help me? The app recovers data from child("grupos") in debugging, but when I tie the knot, for example, child("grupos").child("nome"), the application of crash nor in debugging to see…
-
0
votes2
answers54
viewsHelp with Query Mysql
I have the following query: select profissionais_ab.cns cns_medico, profissionais_ab.cbo, unidade_ab.nome from profissionais_ab join unidade_ab on unidade_ab.id = profissionais_ab.unidade_id Return…
-
0
votes1
answer36
viewsQuery to retrieve information from a foreign key
I own a table that makes relationship between two foreign keys I would like to do a query where I would check the fk_user_1 and get the information from fk_user_2 I did that QUERY: SELECT…
-
0
votes0
answers306
viewsWhich is more performative: "WHERE id IN (?, ?, ...)" or "WHERE id = ? OR id = ? (...)"
I am not an expert in Mysql, but I am studying and lately I am trying to improve some codes of my programs and I came across this situation. I wonder if there are differences between the querys…
-
0
votes0
answers64
viewsHow to use two Join followed SQL
How can I use two joins in a row, and the second will use the table data generated by the first? I want it to relate the Join by the same data, where in the first Join it unites the data of table A…
-
0
votes0
answers27
viewsSort columns by category
I need to select and leave everything organized according to its category: An example: https://novaframework.com/documentation/v2.2 My table is like this: Categories: Articles: My query: $query = "…
-
0
votes1
answer187
viewsQuery mysql rows for columns
Hi, I know there are some similar questions here already, but none of them helped me. I have the following table in my database: +----------+---------------+--------+ | id_bolao | data_concurso |…