Questions tagged as 'query'

1
answer

mysql query problem

I'm having a problem while doing a mysql query. I want to select the id and name of all the presents, except those that are already in the reservation table. SELECT DISTINCT tb_presentes.id_presente AS value_id, tb_presentes.nome...
asked by 26.01.2018 / 16:40
1
answer

Error in update sql: Subquery returned more than 1 value. This is not permitted when the subquery follows

I am doing a query to change the net cost of a product according to a brand, but I get the following error message:    Subquery returned more than 1 value. This is not permitted when the   subquery follows =,! =, & lt ;, < =, & gt ;, >...
asked by 10.01.2018 / 12:56
1
answer

how to do native query with pagination?

I'm getting a simple select, but I do not know the structure of how to do a select using join. Here is the code below: This code works: @Query(value = "SELECT * FROM tabela1 /*#pageable*/", countQuery = "SELECT count(*) FROM tabela1"...
asked by 13.11.2017 / 18:26
1
answer

Convert query to SQLServer

I have the following query for the Oracle database: select xmlagg(xmlelement(e, d.delinha, '').extract('//text()') order by d.nulinha).getclobval() . I need to convert to run on SQLServer database, but I can not. Does anyone know of...
asked by 10.11.2017 / 12:56
1
answer

Subquery returns more than 1 row MySql

Follow the code below that is causing the error quoted in the title: select (select id from message where user_from = tempMsg.user OR user_to = tempMsg.user) as id from tempMsg How can I solve it? Could someone help me fast?     
asked by 07.11.2017 / 01:19
0
answers

text_field with where to search in rails

I'm starting to study rails and I'm trying to search by name and date in a list. I would like to display on the screen inside the show page this search by name and date where am I trying to create the form in the view <form> <%=...
asked by 31.10.2017 / 18:13
0
answers

What is the meaning of Overhead in physical database design?

I just read about physical design and database tuning and I could not understand the concept of overhead, and therefore I could not understand what the author of the book wanted to explain. Previously I understand overhead as an overload or...
asked by 06.11.2017 / 20:49
4
answers

Performance of COUNT (*) and COUNT (1)

What is the difference between COUNT(1) and COUNT(*) in an SQL query. For example: SELECT COUNT(1) FROM USUARIOS; and SELECT COUNT(*) FROM USUARIOS; Is there any difference in interactions within SBGD? Which would...
asked by 20.06.2017 / 19:41
2
answers

Deleting Duplicate Values in SQL

I have a problem with a query, because there is only one field that differs from one data to the other. I have tried to use group by , order by , having , I have researched in several forums, I have tried everything and I can n...
asked by 20.09.2017 / 16:13
1
answer

Select record that contains result equivalent to a variable

I have a column in my mysql table, where it is called "positions", where several values in int are placed there, however, with the "|" of division. Example: 8 | 19 | 10 | 20 | And each number represents a category. I would like to do...
asked by 05.10.2017 / 18:15