Questions tagged as 'sql'

1
answer

Problem inserting into table in Postgresql

When I'm going to make a INSERT : INSERT INTO categoria (cat_descricao,cat_status) VALUES ('não' ,'1' ) by passing some element with accentuation the following error occurs    ERROR: 22021: invalid byte sequence for encoding "UTF8"...
asked by 14.12.2016 / 14:09
1
answer

Indices in primary key columns

I know that each case is a case, and that there are no ready rules about creating the indexes. In my case, since the primary key for each table in my database is used in wheres of my queries to the database, should I create an index for t...
asked by 13.08.2016 / 04:04
1
answer

How to remove words between braces {} in the field in Mysql?

I have a table that contains a field with some values in braces, how do I exclude the chaves and the valores that are inside them? Example: cod | Movimento | 01 | Prazos {aguardando} | Prazos {aguardando}...
asked by 20.11.2017 / 11:39
1
answer

Doubt to bring data from mysql

I have the following question. Consider that I have the following sales data: Two states: São Paulo (Atibaia, São Paulo and Campinas) and Paraná (Londrina, Curitiba, Cascavel). | cidade | estado | vendas | |-----------|--------|--------|...
asked by 11.09.2016 / 20:06
1
answer

How to calculate the distance between X and Y with points of Intersection

In the image above I have mapped the separation positions inside the warehouse where I work. I need to calculate the distance that the person who is separating goes through the warehouse. For example if the person is separating in position...
asked by 30.06.2016 / 14:59
2
answers

Get records with more sorting in SQL

I have two tables: comentarios ---id ---comentario ---usuario ---supermercado ---avaliacao supermercado ---id ---nome ---endereco ---admin I want to take the average rating of each supermarket and take the 3 supermarkets with the highest a...
asked by 03.05.2016 / 21:05
2
answers

Multiple-field sql search in java

How to do a sql search in java that involves multiple arguments? Example: I want to research all people with Angolan nationality, Computer Science course and two or more years of professional experience. I'm using this way: select * from c...
asked by 22.04.2016 / 17:33
1
answer

Select dates based on the total sum of a given column [closed]

Good evening. Based on the example sample file attached, I would have to select all the dates that are the same and are in the same restaurant and that the sum of the quantity is > 10, because I need to disable those dates from my datepicker....
asked by 20.07.2016 / 03:18
1
answer

MySQL not connecting connects by error in socket

Good afternoon friends, after correctly installing MySQL 5.7 on my Ubuntu 16.04, when trying to connect to the database, I get an error message saying that it was not possible to connect through the socket. Execution: mysql -u root -p...
asked by 24.07.2016 / 20:28
1
answer

Go line by row of a table

I have a temporary table that I fill in with the result of a given query. I need to move the data from this temporary table, line by line, and pick certain fields and insert them into another table, and in that other table, generate a coupon...
asked by 19.12.2016 / 20:40