Questions tagged as 'sql-select'

1
answer

How to return only unmatched records in a JOIN? [duplicate]

I have a question regarding the use of JOIN in SQL in this case: I have a produtos table and a destaques table that contains the id of the product. I need to make a query that returns only the records that are n...
asked by 17.10.2016 / 00:50
3
answers

How to get around an accent in mysql + Php

I have in my database words with accents and when I want to call I use this SQL below. But if a word in the database has an accent I also need to use the word accented in my search, otherwise it returns nothing. How do I get around this si...
asked by 15.12.2014 / 13:46
3
answers

Is there a way to start a Select (SQL) in the middle of the data table?

Is there any way in the SQL language (and using BD mysql) where I can start a Select in the middle of a table? For example, I have 500 addresses in the table. I search the addresses of Bairro X (where neighborhood="x"), reducing the total to,...
asked by 19.12.2017 / 16:35
1
answer

Prefixes in SQL Statement

In SQL Server it only accepts 4 prefixes in sentences, eg Select * from pmv.banco.dbo.tabela . In this case, I'm using a client linked server. However, when I refer to some table field, where I would get a prefix ( pmv.banco.dbo.tabe...
asked by 16.06.2015 / 18:16
1
answer

Check registrations between today and 10 days in the future to send by email

I'm using PHPMailer to send an email with data when it's 10 days to complete. When I send the email, all records are appearing when the idea is to appear the registrations between today and 10 days in the future. Inquiry $sql = " SELECT t...
asked by 03.03.2014 / 12:17
1
answer

SELECT in VIEW generates subquery?

I would like to know if I make a VIEW with a simple query, if the call of the view generates a new SELECT, that is, a sub-SELECT totalizing 2 SELECTS or if it only points to the SELECT from within VIEW ? I only executed SELECT fr...
asked by 27.07.2017 / 20:07
1
answer

Query - Bring 5 higher records

I have the query below, where I need to bring only the 2 largest columns that have the highest values. Today is coming out like this: Conciliacao Extrato Integração 150 140 80 That is, I wanted to bri...
asked by 02.08.2017 / 23:50
1
answer

Variable comparison in C, and MySql field [duplicate]

I am trying to compare the name variable entered by the user, with the value obtained in the column name MySQL . char name[45]; //declarando variável name scanf ("%s", &name); //Lendo variável name mysql_query (&mysq...
asked by 12.11.2016 / 20:45
1
answer

Select Distinct returns repeated data when I use Row_Number

I'm trying to make paging with SQLServer 2008 as follows: WITH CTEResults AS ( SELECT DISTINCT SolicitacaoServico.AutoId AS Id_Solicitacao, Pessoa.Nome AS Nome, Beneficiario.Codigo A...
asked by 12.02.2016 / 15:03
1
answer

Do select searching for the 3 highest values

I have a table that has the following data:    id_indication, id_user, lg_client A user can indicate multiple clients (lg_client = 1) , would like a select that searches the 3 users who indicated the most, ie the three id_user that t...
asked by 31.12.2015 / 11:17