Questions tagged as 'sql'

3
answers

Problem with INSERT INTO

I'm trying to make a INSERT in MS SQL , when running the code, there is no error, but does not INSERT in sql, when running a script manually in sql it writes without any problem I have tried both ways, which is also discus...
asked by 21.07.2015 / 17:18
1
answer

Select max in nested queries

I have to select the candidate who has more publications than any of the other candidates. select candidato.nome, Count(1) as nr_publicacoes from candidato, cv,ficha_inscricao, publicacao_cv where candidato.bi = ficha_inscricao.bi and...
asked by 20.11.2015 / 10:06
1
answer

MySQL select random with priorities

I have the following scenario, I have a table and I need to make a select with an order by RAND (). But I'd like to put some conditions for example: TABELA ID | NOME | IDADE | GRUPO    Data 1 | Hiago | 20 | 1 2 | Igor | 15| 1 3 | Ana| 18...
asked by 21.11.2015 / 02:02
1
answer

How to check the occurrence of a string in a line and get x characters to its left and y to the right?

I have a problem with a MySQL query and I'm looking for help. Suppose I have many rows in the PROCESS column and one of them looks like this: IBAMAPROCUR: DF00025372 ADRIANA MAIA VENTURINIAPDO: JOSE DOS I want to check if there are 25372 ch...
asked by 22.05.2015 / 15:11
2
answers

Passing values from a select to subselect

I have the following query: SELECT rp.colaborador as codigo_, t.nome, count(rp.*) as presencas, ((100 * (select count(rp.*) from empresa.cad_reuniao_presencas rp join empresa.cad_terceiros t on t.codigo = rp.colaborador join emp...
asked by 21.05.2015 / 18:51
1
answer

Mysql query intervals

I need to mount a select, where I need to display the results outside of a range of code. For example: I have code 2 as a start and code 6 as an end, how could I not display codes 3, 4 and 5 and only display code 1 and from 5 onwards? Only with...
asked by 01.12.2015 / 14:40
2
answers

Select dates

I need to make a select that brings me instances that the start date of a license is less than 3 years from an employee's date of admission Below is an excerpt from my code. SELECT * FROM jmh_licenca l INNER JOIN jmh_servidor s...
asked by 02.12.2015 / 13:35
2
answers

Convert the SQL syntax of the Firebird database to Postgres database at runtime

I have a system developed in Delphi 7 already stable using the Firebird database, and some clients have requested that they can use Postgres as a database on that same system. As in some SELECT'S, my system uses some reserved Firebird words,...
asked by 24.11.2015 / 21:08
1
answer

Maximum query text size sql

What is the maximum length of an sql query string? (maximum query statement) Ex: SELECT * FROM ajuda WHERE (id = 1 OR id = 2 OR id = 3 OR... @edit: The bank I was using (access) has limits other than those set by @PauloHDSouza. Numbe...
asked by 02.12.2015 / 15:51
2
answers

Save array of images in different columns

Good evening. I would like to count on your help in solving a problem that has been grinding my molecule for a few days and I still can not find a solution. I have the following code to send to the 4-photo server: if(isset($_POST['su...
asked by 11.12.2015 / 05:11