Questions tagged as 'query'

3
answers

Doubt when using ON DUPLICATE KEY UPDATE

I'm trying to use ON DUPLICATE KEY UPDATE in my query and for some reason is not working. I remove the ID and do not use ON DUPLICATE KEY UPDATE : the values are saved in a new line in the bank. Example: $sql = "INS...
asked by 14.09.2015 / 17:50
1
answer

Ways to get bank values with ResultSet

Ways to get Java database values (JDBC). public static Connection getConnection(){ /* 1. Faz a conexao com a base de dados */ /* 2. Retorna qual banco ira trabalhar */ Connection connection=null; try {...
asked by 20.06.2015 / 00:47
1
answer

How to prevent a simple query from locking the entire MySQL database

I have an application in Rails that uses a MySQL database with a table with millions of rows. Sometimes it happens that some part of my application does a very heavy query, locking all the rest of the application. How do I prevent these pesky qu...
asked by 13.08.2014 / 02:53
2
answers

Query N records by Item

I have a history table in DB2 and I would like to do a grouping by PLACA but despite this I would have to return the last 5 records of each PLACA . Ex: |ID |PLACA | DATA | VALOR | |12 |ABC | 2014-08-28 | 4.50 |...
asked by 28.08.2014 / 20:17
1
answer

Query using Hibernate does not record

I'm trying to query the HSQLDB database using Hibernate but I'm not succeeding. When I do: session.get(Usuario.class, new Integer(1)); Query is done because it shows the query mounted by Hibernate. But it does not have any registry, even...
asked by 19.05.2018 / 17:09
1
answer

MySQL and PHP clustering

I need to group a query with a detail, grouping should be done only when the information is repeated in sequence, for example: id nome 1 lucas 2 lucas 3 marcos 4 lucas 5 marcos In the example above, only the "lu...
asked by 12.01.2018 / 16:56
2
answers

Database, display name via ID [closed]

Someone could help me. Have the following tables PLAYERS id name nickname status EVENTS id date local_id PLACES id event_id winner_id loser_id the winner_id and loser_id fields, store the player id in the PLAYERS table, how...
asked by 11.09.2017 / 23:27
1
answer

Creating Trigger

I need to develop a trigger where any change that occurs in one of these fields below the Task table should send the task information to the Instruction table. TASK TABLE TarefaID Vencimento Status Caminho ModuloID 170123...
asked by 31.10.2017 / 13:14
2
answers

How to use the like in a field comparison in different tables?

How can I use LIKE for a comparison of two different table fields? I need to compare the first 5 characters of each field. I tried SUBSTRING and with LEFT , however, the performance gets pretty bad. Here are two ways I applied, with the c...
asked by 22.02.2017 / 13:40
1
answer

Converting an nvarchar data type to a datetime data type resulted in a value outside the range

Line of code INSERT [dbo].[Shop_Goods] ([TemplateID], [Name], [Remark], [CategoryID], [Description], [Attack], [Defence], [Agility], [Luck], [Level], [Quality], [Pic], [MaxCount], [NeedSex], [NeedLevel], [CanStrengthen], [CanCompose], [CanDrop...
asked by 21.07.2016 / 17:00