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
votes3
answers5873
viewsRemove repeated lines in all aspects on Oracle
In a column REGISTER I have two lines repeated in all aspects: NOME ID EMAIL SEXO JOAO 1234 [email protected] M JOAO 1234 [email protected] M How to compare these two rows, check if all columns are…
-
0
votes1
answer1092
viewsHow to get the current date minus two years in mysql?
I need to show in a query some items between the current date of the time in question and two years before.
-
0
votes2
answers522
viewsBulk change to MYSQL
Hey, guys, all right? I have a database in mysql and I need to make a massive change, it’s like? I want to change all records from the "show_address" column of the ptv_osrs_properties table to "1".…
-
0
votes1
answer70
viewsCorrectly insert data into table
I’m in serious trouble with the INSERT of PDO, I am unable to add the values correctly to the banco de dados, how to proceed in this situation? Picture of the problem: I’m waiting for help. <?php…
-
0
votes0
answers30
viewsHow to insert default values into the table along with a variable value?
Setting: I have a database with 2 tables, table A has the screens of an app, and screen B records the activity on each screen, getting this way: ____________________ | Tabela A | -------------------…
-
0
votes2
answers2013
views -
0
votes1
answer75
viewsFine-tuning Ranking for a Game System
I have a very crazy problem that has already burned my logic ability. A while ago I posted a question almost like this but and they helped me a lot (I really appreciate it) but my need changed and…
-
0
votes1
answer418
viewsCount the amount of my IF records
IF(Count(UCID)>1,Count(UCID),'0'), it brings me approximately 500 lines of record, being numbers of 2 above, I want to be able to make a COUNT in that IF to present those 500 in a column to part.…
-
0
votes2
answers76
viewsHow do I search for a string in a table on Android?
I want to search using the "Clas" field, which is a String. And listPsearch gets a String. public Cursor listPesquisar(String pesquisa) { Cursor cursor; String[] fields = new String[]{"_id", "nome",…
-
0
votes1
answer105
viewsHow to find a word in 10 tables in Mysql
I am making a form for a search, and when searching for something, I intend to return several values of various tables that exist. As such, I would like to know the easiest way to do a query, in…
-
0
votes1
answer733
viewsReturning an array of a function in Postgresql
I’m having a question here that I need to solve with a postgresql database function. The problem is this, I need to cross a table that’s called stocking with a view called stockpile. In this table…
-
0
votes1
answer38
viewsResult with repeated records
Good afternoon! I’m making a query, but the result is bringing repeated occurrences. there is some command for the query to only bring a record of each column? follows script: SELECT * FROM…
-
0
votes1
answer632
viewsSQL to check skipped number
I have a table with 12,560 records from 5 years ago, that is, it does not have such a good modeling and it has a field called 'code' that the user filled with something like CA-0001. The problem is…
-
0
votes1
answer62
viewsDoubt Beginner SQL
I need to know what the following queries accomplish, but I am doubtful, because I am starting to study SQL now. You can help me? "SELECT user_id, CAST(SUM(points_per_badge) AS INT) " + "FROM…
-
0
votes1
answer1685
viewsC# - Display search results in Datagridview (SELECT SQL)
Hello! I’m actually starting at C# and I already have small projects. I can already connect to the remote database, I can already run queries, I just can’t get the result of a Select and show in a…
-
0
votes1
answer199
viewsQuery does not return results in PHP
There is a query in my PHP where you search the email list and return to PHP, however, it is not returning any results. The PHP Code looks like this: <?php session_start("admin");…
-
0
votes1
answer102
viewsKnow Count() output in query
I have the following query on Pdo: $ranking = $pdo->query("SELECT * FROM usuarios GROUP BY moedas ORDER BY count(moedas) DESC LIMIT 3"); I use this to make a ranking to know users with more…
-
0
votes2
answers1141
viewsPostgresql - Query data from a range and bring a boundary of lines but spaced
Good morning Guys, all right? I have a performance problem in a system and need to solve by customizing an SQL. Let us imagine the following scenario: - A table with millions of records, each record…
-
0
votes1
answer184
viewsUse of the Eloquent hasManyThrough
// Modelo Cliente public function plano() { return $this->hasManyThrough('App\Plano', 'App\Plano_cliente','cliente_id','id','plano_id'); } //Modelo Plano public function cliente() { return…
-
0
votes0
answers545
views -
0
votes0
answers52
viewsList with WHILE a QUERY with 2 Joins
I am trying to make a report by joining 3 tables. But the table is not being generated. The query works in PHPMYADMIN, but not in php. Database running the Query PHP code $sql = "SELECT…
-
0
votes2
answers416
viewsComparison of two dates using Mysql varchar type
I have a question regarding the preparation of an SQL query in which I pass a registration date and check if it is bigger than the current date, but I have a problem the registration date is varchar…
-
0
votes1
answer35
viewsQuery revision
I have this query in order to list users with more comments, however, it cannot display users with the banned column=true. SELECT * FROM usuarios a INNER JOIN topicos_comentarios b ON a.usuario =…
-
0
votes1
answer584
views -
0
votes2
answers48
viewsInsert error ... Values using oracle error 00936
I’m trying to make an Insert on a table and it’s always giving me error 00936 that says Missing Expression when you arrive at the command line cmd.executenonquery. Can anyone help me? Code I have:…
-
0
votes1
answer516
viewsJOIN between tables with some (s) of them empty
Goodnight I have 6 tables (A,B,C,D,E,F) A tabela A sempre contém registros e tem uma chave primaria ID The other tables B,C,D,E and F are all daughters of table A and have a column FK_ID that…
-
0
votes1
answer100
viewsSQL query is not grouping
I’m new in SQL and I’m trying to group the data as query below, however, is not grouping. The correct one was to leave, for example select left(P.ProjDesc,6), COUNT(P.ProjID) from Projetos P where…
-
0
votes1
answer494
viewsDoubt - Query (Do not bring a particular record)
Good afternoon Galera! Next, below is a query where it was to bring all the calls that has the description ''Block Client - Delinquent' and with id = 572 (blocked clients), however, this query has…
-
0
votes2
answers94
viewsDynamic data entry in 2 tables
Good afternoon, everyone. I have the following situation: In a vehicle registration module need to dynamically register and at once a vehicle followed by all its models and group, and a vehicle can…
-
0
votes2
answers204
views -
0
votes1
answer181
viewsMYSQL: Find subsequences in a sequence and group by ID
I have a table with the following result: ------------------ |seq | ID | ------------------ | 1 | 12345 | | 2 | 12345 | | 3 | 12345 | | 4 | 12345 | | 8 | 12345 | | 9 | 54321 | | 10 | 54321 | | 11 |…
-
0
votes1
answer59
viewsTags in a table for each?
I have the table "news"and I will make a system of tags, these tags will have to have a table for each or just a table ?
-
0
votes1
answer78
viewsPHP and Javascript - Adjusting Mysql Table Search (Doctrine Query)
I’m doing on my client page, which I took over from another developer, a section to search for events registered in the Mysql database. How is that page: <div id="detalhesBusca"…
-
0
votes1
answer90
viewsMysql update event
I asked this question yesterday, I got the answer I wanted, I’ll be straight and straight: I have the query: UPDATE users SET time = time - 1 time is the type int and receives as default value 0, in…
-
0
votes1
answer370
viewsConcatenate SQL Server records
I have a problem with a query, where I need to concatenate records from a table. I need the select take the FormID and concatenate the records of AcaoID only if Permitir for 1. Query: Declare…
-
0
votes1
answer178
viewsQuery the user data
Hello, I wonder if there is possibility to query user attributes and display on screen. To register the user I am using the plugin final Member, which by default only displays the user’s photo and…
-
0
votes2
answers64
viewsDoubt - SQL Server Query
As I do in sql server to get the records larger than 10 days from the current date, that is, in the current month, I want to get all the records prior to day 01-08. I tried that way, but you didn’t…
-
0
votes0
answers25
viewsMysqli query returns FALSE instead of returning database records
Hello, I’m trying to query the user login data in the php database but I noticed that the variable that receives the function that makes the query always returns empty and I var_dump this variable…
-
0
votes0
answers1569
viewsConsult a record on Sqlite
I’m having a problem to perform a query in a Sqlite database of an android application I’m studying. I can recover all the records that the database contains, but I can’t search a single table…
-
0
votes1
answer35
viewsQuery with NOT IN in mysql
I have 2 tables (function and function_situation). I need to bring in the employees in their proper situations. The big x of the question is not to bring in some employees who are in some situations…
-
0
votes1
answer63
viewsPrint dynamic query
I have a query in a system where the user selects the month and the corresponding records are shown on the same page. I want to print the result of the query but how the form sends via GET: <form…
-
0
votes0
answers66
viewsMake SELECT display a certain value of a column last, keeping sorting by another column
I am doing the following select in a database and displaying the result in a php table: SELECT ID_PRDC, PRDC_ID_PRDT, PRDC_ID_SEM, DATA_PRDC, LINHA.NM_LN, PRODUTO.NM_PRDT, SEMI_ACABADO, NUM_OP,…
-
0
votes1
answer264
viewsBackdate in mysql
Good morning to you all! how do I, in a query in mysql, find the date related to 3 months ago?
-
0
votes1
answer292
viewsSQL search for more than one type of property, city and neighborhood does not work properly
I got a template ready with some problems in plugins and queries. Of the 6 select fields to do a real estate search, 3 of them can select more than once, property type, city and neighborhood. The…
-
0
votes1
answer87
viewsPicking last value of each ID according to highest end year
I have the following query: select f.id_user as user, f.id_tempo, t.ano_inicial, t.ano_final from fato as f inner join tempo as t where f.id_tempo = t.id_tempo; Which returns me the following table:…
-
0
votes1
answer275
viewssum specific line in Mysql
Speech person! I am doing the insertion of a time (hour:minutes:seconds) in a column x, I wonder if it is possible to add the current value of the line with the next value that is inserted? like…
-
0
votes1
answer3159
viewsQuery sql with longer and shorter date limit
My code should return values from the database, related to the current day (today), but only related to the month and day, I searched a lot but could not find something to help me $data_atual =…
-
0
votes1
answer80
viewsPHP Fatal error: bytes exhausted After running query
Hello, in a certain process of my code I need to execute a query that returns me 4500 rows from the database return Property::whereHas('portals', function ($query) { $query->where('portal_id',…
-
0
votes0
answers24
viewsQuery does not return value
I have a query in the header of the page that returns the title, the meta name="Description" and the meta name="Keywords" that works very well. However, applying this same query structure in the…
-
0
votes0
answers149
viewsMysql > query with dynamic columns
Friends I have a question.... I have the following tables in Mysql: alunos (id, nome, etc) turmas (id, turma, etc) matricula (id, turmaID, alunoID) disciplinas (id, turmaID) avaliacoes (id,…