Questions tagged as 'sql'

1
answer

Is it better to repeat field or join to access the relationship?

Hello, thinking about performance and also good practices, what would be the ideal in this scenario? 3 Objects: - Company - Person who is representing the company - Visit (object related to a commercial visit of a seller) For me to display...
asked by 26.01.2018 / 16:04
2
answers

Attempting to search with specific id in a period

I'm trying to get a specific car between dates, because it works in periods, but I need to get the element ID, I do not know if I would have to apply some other query or include it, the database I use is SQL, case there is doubt I want to do...
asked by 21.12.2017 / 21:10
1
answer

MYSQL Sub Query (SELECT MIN)

I have this code, but what I want is SELECT MIN of "n_reminders" and only just the min number. I wanted the club with fewer rowers. Help? :) SELECT (clube.nome) AS clube, COUNT(remadores.cod_remador) AS n_remadores FROM clube,...
asked by 09.01.2018 / 16:31
0
answers

duplicate ID's in sql query

My friends have an appointment like this: SELECT v.product_id,nome AS Produto,presentation AS Descricao, presentation AS Descricao2, name1 AS categoria, description_two AS descricao, price AS preco, quantity AS estoque, width...
asked by 13.12.2017 / 23:53
1
answer

Select in two tables. How to return a single list?

I have a Process table, with basic data and other ProcessesDestaque, with more specific data. I need to make a select that calls some columns of the basic data and some of the specific data. I tried to make a list, but I can only call the data f...
asked by 04.02.2018 / 01:44
0
answers

Monitor Mysql server activities

I have a system (php and mysql) hosted on the network here in the company, installed in several stations. I would like to know if there is any command or tool to monitor the requests (queries) made to the MYSQL server? Something similar to SQLSE...
asked by 09.12.2017 / 16:55
1
answer

Automatically delete a record from a table after a time interval

How do I stop the log after a time interval, such as in a shopping cart, for example?     
asked by 18.12.2017 / 13:29
1
answer

Prioritize keywords found in title in sql search

Hello, I have a 'videos' table with 3 fields 'name', 'description' and 'categories'. When doing a search I want to appear at the top videos that in the 'name' have more of these keywords, for example if I search "beautiful house" a video with na...
asked by 09.12.2017 / 16:43
1
answer

SQL Summation

I need to make a report with SQL , which asks me the following situation. In the general report, I need it to look like this: Produto Quantidade Total Valor total Salpicão 30kgs 810,00 The detail is,...
asked by 19.12.2017 / 13:59
0
answers

SQL script monitoring [closed]

Someone can help me, In my company I have a script that verifies how many emails were processed and sent by the server, but sometimes the program that makes the uploads hangs and I only know that it has blocked why my users complain that ther...
asked by 10.01.2018 / 11:54