Most voted "mysql" questions
Mysql is a relational database management system (RDBMS) that functions as a server, and provides access to multiple users simultaneously. Your source code is available under the GNU General Public License.
Learn more…10,264 questions
Sort by count of
-
6
votes4
answers114
viewsHow to make a query that returns the last record of each day?
The doubt is simple, but unfortunately I don’t think the resolution. I have a table with several records, and I need to perform a query that returns the last record of each day of the last 20 days…
mysqlasked 8 years, 10 months ago Christian Beregula 1,512 -
6
votes1
answer1044
viewsSave the result of a variable to the Mysql database using python passed as parameter
I have a database on mysql which contains a table with several expressions. I can extract the expressions through a procedure, solve them, but when I want to return the value of the calculation to…
-
6
votes1
answer742
viewsImprove the performance of a query
How could I improve this query, which returns me the top 10 sales to assemble a chart, so that it processes more quickly? set @startDate :='2015-01-03'; set @endDate :='2015-05-31'; set @dst_id:=1;…
-
6
votes1
answer2994
viewsModel "Product" table for multiple different product types
How to model the Table Product from a data bank? This table should store the following information: id, product name, quantity, price, status (if it is in stock, if it will be returned) and…
-
6
votes2
answers1032
viewsGenerate sequential java number with Hibernate
Is there any way using Hibernate generate a custom number to be the identification number of a particular record? I have a system that stores care performed to a patient, every time a new care is…
-
6
votes1
answer9280
viewsImport, analyze and extract data from a PHP CSV
How can I import a csv file with PHP and take the data from a specific column and write that data to the database? You can do this analysis and only record specific data (like a column, or row)?…
-
6
votes1
answer23089
viewsHow to pass excel data to Mysql?
First, I have a newsletter system that I modified for email marketing, it’s all in PHP (obvious) and first, I add the emails manually through a part of the site add.php but there are over 3000…
-
6
votes3
answers2944
viewsWhat is the best way to enter a large amount of records into the database?
Hello, I am creating an application where I need to constantly consult a spreadsheet, take the data from it and insert in the database (Mysql). The point is that these spreadsheets will always have…
-
6
votes4
answers11643
viewsError while running Hibernate
After catching a little, I’m walking with my project. When running the project, I have the following error: mai 16, 2016 6:41:22 PM org.hibernate.jpa.internal.util.LogHelper…
-
6
votes2
answers345
viewsValues that can be entered as primary key
I have a company code of the product that is formed by two letters and 4 numbers (example: XX0000), it is advisable to use this code as primary key or create another column with code field and put…
-
6
votes2
answers2348
viewsThe following database modeling is in my head?
I created this modeling (just an idea), so there are no null/white fields. I have not completely reviewed it. There may be fields that would remain blank. The matrix table was the Entities and…
-
6
votes1
answer266
viewsHow to create a scan sequence in the Postgres database?
I have the following table in the database Postgres: CREATE TABLE customer ( userid character varying(30) NOT NULL, firstname character varying(30) NOT NULL, lastname character varying(30) NOT NULL,…
-
6
votes1
answer1911
viewsMaximum size for database tables
What can be the maximum size that a table can have? To make it clearer: a table in Mysql, what is the maximum size it supports? And in SQL Server, Oracle, Postgresql?
-
6
votes1
answer328
viewsError Based on Accentuation
Hello! I’m developing a Hybrid APP that uses a PHP Webservice to send an email and call a Procedure in Mysql by filling it with the same email details, until the email sending part is OK it sends…
-
6
votes3
answers1474
viewsHow to repeat columns up to "x" of times
Well I have a column in my database with names, I write it on the screen, through this code: <html> <head> <title>Pagina Inicial</title> <meta charset="utf8"> <link…
-
6
votes1
answer1328
viewsHow to restrict dates in Mysql and SQL Server?
I wonder if I can restrict certain dates in the database itself, not in the code. For example, I have a table that records date of entry and date of exit. Here are some requirements. The date of…
-
6
votes2
answers188
viewsSQL Query Optimization in Mysql and Index
Guys I’m having a performance problem at a consultation SQL in the MySQL who is using my server a lot, I’ve done index and yet consumption does not decrease. The query I’m using is: SELECT CONCAT(…
-
6
votes0
answers2043
viewsWork with two databases in Laravel
I’m creating an application that needs to connect to two different databases. A database I am creating (Mysql) and a database I received ready that I am only allowed to query (SQL Server). The…
-
6
votes2
answers21084
viewsBrazilian Time Zone in Mysql
I have a Mysql database table called registros. In it, I then have the following structure: id_registro, nome_registro, data_registro. In data_registro i am using the current_timestamp(), searching…
-
6
votes1
answer360
viewsWhat are the risks of saving files to the Apache server with PHP and how to avoid them?
I’m recording an HTML file with part of a page, to be used later by HTMLDocX in the generation of a file .docx (vine this question related). To record use ob_start and ob_get_clean to put the…
-
6
votes3
answers1926
viewsHow do you know how many days are in the current month?
How to know how many days is the current month Mysql, example: setembro = 30dias Motive: I have a goal : exemplo: 1.000,000 I need to take the value of the goal and divide by the amount of days you…
-
6
votes1
answer962
viewsRemote access to Mysql database
I have a BD within a corporate network on a local machine serving as a Mysql server. The structure of the network works like this! I need to access for example the machine that is marked red, and in…
-
6
votes1
answer1308
viewsCreate View in Mysql through Laravel
How can I create a view in the Mysql database through migrations of Laravel? I found nothing in the documentation.
-
6
votes2
answers984
viewsCodeigniter session expiring after an action
I made an administrative panel using CodeIgniter and every time the session is expiring, thus redirecting to the login screen. Every time for example, that I edit a category, after edited and click…
-
6
votes4
answers668
viewsRetrieve dynamic input and insert into the bank with Procedure
I’m having trouble inserting incoming data from a dynamic input. My Procedure only inserts once, follows my code where I receive the data: $ddd = $_POST['ddd']; $userid = $_POST['userid'];…
-
6
votes1
answer2189
viewsUsing while inside while in PHP
What happens in my PHP code is the following: I make a query in the database and with it a DO WHILE (while this query returns records), it displays some information on the screen (based on the…
-
6
votes0
answers54
viewsRedirect a virtual url
How do I redirect a url from my website to a subfolder. Example: Database: ID | ENDEREÇO | ESCREVER NO INDEX.PHP 1 | example.com/extranet | <span>Sou o extranet</span> 2 |…
-
6
votes1
answer462
viewsWhat is the difference between the Mysql Trigger and Mysql Event exception?
I would like to create a e-mail trigger scheduler, without the use of cron, and would like to know if it is possible to do this through Mysql. Searching the Internet I saw some examples of event…
-
6
votes3
answers324
views"Translate" query from Mysql to SQL Server 2012
What is the SQL Server 2012 query that corresponds to the next Mysql query? REPLACE INTO schedule SET jobname = "sqldump" , last_exec_date = NOW()…
-
6
votes3
answers719
viewsHow to get tickets that were open in May?
I’m working with a database that contains all the tickets registered in the otrs of the company where I work. I intend to do a query where I return all tickets that were open in May. The problem is…
-
6
votes1
answer1291
viewsHow to structure a mysql database from a JSON
I have the following structure json test: { "CE": { "Fortaleza": [ { "nome": "Teste", "email": "[email protected]", "cel": "(xx) xx-xx" }, { "nome": "Teste", "email": "[email protected]", "cel": "(xx) xx-xx" } ],…
-
6
votes3
answers604
viewsWorking with tags in Mysql
In a system I would like to categorize some users with tags. However there are groups of tags (for example, UF tag group, Interests). I’m trying to do a query where I can answer some questions like:…
-
6
votes2
answers531
viewsMysql Auto increment even number
I have a Mysql database with a field id that is AUTO_INCREMENT. Has some configuration problem in it because when doing auto increment is coming out exactly in this sequence: ID: 2 ID: 12 ID: 22 ID:…
-
6
votes3
answers401
viewsHow to create Mysql search that returns lines without matching?
I would like to know how I can do a search that returns records that are not part of the research condition. For example, think about the situation where there is a database of a movie rental…
-
6
votes2
answers91876
viewsHow to add a Foreign key to an already created table
I’m a beginner in mysql and can’t add a fk to a table I created. I have two tables (person, object) and I want to create a 'fk_person' in object that receives the value of the 'id' attribute of…
-
6
votes2
answers707
viewsHow to limit display of records to 30 days from today’s date
I wish I could limit the display of news that I have recorded in my banco de dados 30 days from today, for example: View registered news from 03/02/2016 à 02/01/2016, I tried to use some solutions I…
-
6
votes5
answers737
viewsHow to save data from a changed grid?
My system has a grid with order items, coming from the dice. Well, I need to change the requested items, add one more item or even remove. You get the information in json and I’ll put it on the…
-
6
votes0
answers1201
viewssynchronize Local database with Web
I’m developing an application in Cakephp, with a Mysql database. a part is already working but from the beginning I need a solution to the following problem: My application should work online, but…
-
6
votes1
answer155
viewsModeling with Code First so you can exchange databases
If I generate my database for Mysql using the concept of Code First is it possible to change it to SQL Server in the future with relative ease? Need to change the classes or just the config and the…
-
6
votes3
answers1172
viewsHow to make change in order sequence with SQL statement
I have a form where I display to the user some phases that a particular contract needs to respect, follows image of the said form: I’ve already done the update that makes the order change and is…
-
6
votes1
answer1251
viewsHow to filter separate dates by day , month and year in Mysql
Hello, I have a table "Meetings" in Mysql with the following structure: id:Int(11), subject:String(40), day:String(2), mes:String(2), year:String(4), active:String(2) except in the field day the day…
-
6
votes2
answers361
viewsCount friends in common using LEFT JOIN
I have the following tables: users: id | usuario | pnome | snome | foto 1 | Igor | Igor | Souza | perfil.png 2 | Alex | Alex | Khal | foto.jpg 3 | Maria | Maria | Silva | foto.png friendships: id |…
-
6
votes1
answer1749
viewsLimit login attempts by time and quantity
I am working on a login system with php and mysql and this doubt arose, because I do not know if only this can be considered something "acceptable" as another security tool in the login process.…
-
6
votes3
answers688
viewsHow to do in a select html, when clicking select more than one row at a time?
I have a query that brings me the first 3 letters of a month name with the last two digits of the year for example: JAN.16 in my combobox it brings me the independent months for example: JAN.16…
-
6
votes3
answers8795
viewsHow to round a number to the highest value in Mysql?
I was doing some tests on Mysql and then the need arose to have to round a number to the largest. It would be something like: if($numero == 1.5){ $numero = 2; } Even though I could do it like this,…
-
6
votes1
answer610
viewsWhat is the difference between REPLACE INTO or ON DUPLICATE KEY UPDATE
I am with the following doubt what is the difference between using REPLACE INTO or ON DUPLICATE KEY UPDATE in mysql, do not both serve the same purpose to make a change to a field or more in the…
-
6
votes2
answers3829
viewsTake AUTO_INCREMENT value from a table
I want to take the last record registered in a database table, ie the value of AUTO_INCREMENT from the table, I tried using: SELECT MAX(id) as max FROM people It works, but if I have no record in…
-
6
votes2
answers1493
viewsSyntax difference between databases
What is the difference, in the syntax, of the following databases, for a simple query, of the type: SELECT * FROM tabela WHERE id = '1' ORDER BY nome GROUP BY nome LIMIT 1 Or, what do they differ…
-
6
votes2
answers3622
viewsColumn 'XXX' in field list is ambiguous
I am having trouble executing the following Query: SELECT product_id, presentation FROM Variant INNER JOIN productCategory ON product_id = product_id LIMIT 10; Error: ERROR 1052 (23000): Column…
mysqlasked 6 years, 11 months ago J Junior Carneiro 101 -
6
votes1
answer227
viewsList Mysql tables and filter by date
I need only a final value, the commission value for products with extra commission in a date range and a specific seller, the information is in 3 tables in the BD: Below is the table 'Commission…
mysqlasked 8 years, 2 months ago Roberto Gomes 455