Questions tagged as 'query'

1
answer

Problems stopping tables with UNION

I'm trying to get the top 3 from my table and also the last 2 placed, SITE TO RUN SCRIPT This is my current progress that does not work SELECT ('Podium: ' ||TEAM) as name FROM LEAGUE ORDER BY position ASC LIMIT 3; UNION ALL SELECT ('D...
asked by 17.04.2018 / 19:48
1
answer

Delete two ID's from different tables in the same query

Good afternoon! Home I have two tables: 1st questionnaire and 2nd response , and question_id is the key that allows you to interconnect the two tables, foreign key in table "answer" of the "questionnaire" table. Home When I enter a r...
asked by 26.06.2018 / 16:40
2
answers

Search for the last 24h lines that repeat the most (MySQL)

'SELECT 'from', 'to', count(*) AS num_clicks FROM my_rank WHERE my_rank_data BETWEEN "'.$yesterday.'" AND "'.$today.'" ORDER BY num_clicks DESC LIMIT 0,20'; Above I'm trying to get the "from" and "to" fields from a table, but I only want the l...
asked by 22.02.2018 / 02:15
1
answer

How to make an INNER JOIN by bringing specific fields from two tables and removing the repeated records and with a max condition?

Well, I have the following tables: Table 01: Andtable02: Then I would like to bring only all the fields with bigger points and do not repeat the waiter in case, how to do it?     
asked by 19.11.2017 / 22:08
1
answer

What is the difference between the query with '(quotation marks) and without' (quotation marks)?

Good luck, I want to know the difference of a value involved with '(quotation marks) and value without the' (quotation marks). Ex: SELECT * FROM dados WHERE nome = $nome (valor sem uso das aspas) SELECT * FROM dados WHERE nome = '$nome' (va...
asked by 15.01.2018 / 02:28
2
answers

Doubt - SQL Server Query

How do I get the sql server to get the records longer than 10 days from the current date, ie in the current month, I want to get all the records prior to 01-08. I tried it that way, but it did not return anything. SELECT S.SolID [Chamado], UC....
asked by 10.08.2017 / 19:55
1
answer

sql search with higher and lower end date

My code should return values from the database, related to the current day (today), but only related to the month and day, I searched a lot but could not find something that would help me $data_atual = date("d-m"); $mostraDados = mysqli_query(...
asked by 13.10.2017 / 07:42
1
answer

Doubt - Query (Do not bring a certain record)

Good afternoon, people! Next, below is a query where it was to bring all the calls that have the description '' Block Customer - Defaulter '' and with id = 572 (clients blocked), however, in that query there are some clients with already been...
asked by 20.07.2017 / 22:46
1
answer

SQL query is not grouping

I am new to SQL and I am trying to group the data according to the query below, but it is not grouping. The correct one was to exit, for example select left(P.ProjDesc,6), COUNT(P.ProjID) from Projetos P where P.ProjStatus <> 9...
asked by 20.07.2017 / 16:45
1
answer

How to decrypt records from a SQL column - Query

Good morning! Well, how to decrypt records from a column in an SQL query. The field I want to decrypt is coluna MAX(A.Descricao) [Descrição da Última Providência] . SELECT CONVERT(DATE,T.TarData,103) [Data de Abertura], CONVERT(DA...
asked by 04.07.2017 / 16:50