Questions tagged as 'sql'

1
answer

Connect Java system to the database on the server

I have a Desk system in which I'm trying to connect to a database that stays on the server. But every time I try to connect it gives the following error:    java.sql.SQLException: null, message from server: "Host   'nco-inf-04.cop.com.br' is...
asked by 12.08.2015 / 13:28
1
answer

SQL JOIN - Build according to the base

I would like to create a SQL using LEFT JOIN. I did this SQL, but it did not work: SELECT *, p.parametro AS cidade, cpr.codTipo AS tipoAcompanhante FROM cadastroperfil AS cp, cadastroprofissional AS cpr, parametr...
asked by 09.08.2015 / 02:24
2
answers

How to streamline searches in VB.net / Access97 database

I use a query that does the search in 3 different tables, return this query attribute in a Datatable that will fill a Datagridview . The problem is that the search itself is a little time consuming, I used TOP as a limit...
asked by 14.07.2015 / 17:22
1
answer

Foreign key registry query with multiple occurrences

I'm developing a system for storing documentation for day-to-day use with PHP and mysql, and to make it easier to query, I have added tags to these documentation and to ensure the integrity of the data I added another table called documentacao_t...
asked by 01.10.2015 / 21:13
1
answer

Predict the next Bank ID

if (is_uploaded_file($_FILES["foto"]["tmp_name"])) { $imagem = time() . '_' . $_FILES["foto"]["name"]; $diretorio = 'fotos/ {{{AQUI VIRIA O NUMERO DO ID }}}' . $imagem; if (!move_uploaded_file($_FILES["foto"]["tmp_name"], $diretorio)) {...
asked by 01.10.2015 / 22:51
1
answer

IF conditional within SQL query

I have the following query: $string = " SELECT DISTINCT(idClientes), nome FROM clientes WHERE idClientes IN ( SELECT idClientes FROM planosclientes WHERE idPlanosClientes IN ( SELECT distinct(idPlanoClientes) FROM pagamentos WHERE mesRefe...
asked by 30.09.2015 / 18:08
1
answer

Shipping Table - Neighborhood Listing

I have a table named bairro : Ihaveatablenamedtabelafrete: I have the following SQL public function getBairroList() { $sql = "SELECT * FROM bairro as b Left join tabelafrete as t on b.idBairro = t.idDestino where t.idSai...
asked by 10.06.2015 / 04:38
1
answer

Search for records from a date to Another [closed]

The company has the base closure of "21 to 20" each month. I would like to know how do I make SQL search only the records that are within the closing? Ex: my closing this month is: 05/21 to 06/06, but I do not want to get the last 30 days ... I...
asked by 11.06.2015 / 07:15
1
answer

Conflicts in MS-Access

I have a table in an access database with the following fields: DATA | SALA | AULA1 | AULA2 | AULA3 | AULA4 | DOCENTE | TURNO ---------------------------------------------------------------------- 02/02/2015 | S1 | 1 | 1 | 0...
asked by 17.06.2015 / 19:52
1
answer

Mysql error 1215: Unable to add foreign key constraint

How do I resolve this error? I know that one reason for this is that the columns must have the same size and specification. But I've tried everything and it's not working. CREATE DATABASE'sistema'/*!40100DEFAULT CHARACTER SET utf8*/...
asked by 07.06.2015 / 17:37