Questions tagged as 'query'

1
answer

Add fields to a select

How do you put the driver and the idle in my SELECT: CREATE TABLE Obra_Assunto ( idassunto INTEGER NOT NULL, idobra INTEGER NOT NULL, PRIMARY KEY (idassunto, idobra), FOREIGN KEY (idobra)REFERENC...
asked by 06.06.2018 / 14:42
1
answer

Doubt - SQL Server 2012 Query

Galera, in the query below to want to place a condition inside the where that only brings the tasks that they have with maturity two months after the opening date. For example. Task 11111 was opened on 11/01/2017 and has expiration on 01-01-2018...
asked by 21.12.2017 / 15:22
1
answer

Registering the value of a variable in a table

I'm trying to save data from 2 variables in a table, but when I look at the table in the database the values are recorded as 0. public void inserir(List<Conta>list) { List<Conta> lista = new List<Conta>();...
asked by 24.02.2018 / 21:26
1
answer

Optimize module 10 SQL Server

I have a database created in approx. a decade, this same bank has several records and obviously, being in production, can not be changed from day to night. The problem is:    The products registered in the bank have serial, these serial at...
asked by 04.12.2017 / 19:18
2
answers

How to use pseudo names with CONCAT and MySQL?

A question about MySQL asks for the output to come out in that response format. When I finish my solution through a query in MySQL , I encounter the following problem. Below is a first example solution of my query that Works...
asked by 02.12.2017 / 20:53
2
answers

Make an array for a query with false conditions

I have the following query , where the conditions are informed from a array : $args = array( 'post_type' => 'post', 'post_status' => 'publish', 'orderby' => 'date', 'order'...
asked by 11.10.2017 / 22:04
1
answer

Pass a php array in a query and return multiple results [closed]

I want to pass a POST dynamic array of type: array(2) { [0]=> string(1) "1" [1]=> string(1) "3" } For an SQL query that returns multiple results depending on the string values in the array Select nome, count(avaliacao) FROM tabela W...
asked by 27.09.2017 / 10:49
1
answer

Separate column in multiple lines (split)

I have a cidade_bairro table with several cities and neighborhoods. I want to transfer this data to a new table, but on several lines instead of being in one. EX: Cidade Bairros<br> SP | Consolação-Morumbi-Saude In the n...
asked by 13.09.2017 / 20:34
3
answers

Return Id's That Are Not in the Database - MYSQL

Problem In a table X and I have N records, however these records are not sequential (throughout insert ), Id will always be greater than previous, but not necessarily the number following the previous one.) I need to know what id's...
asked by 10.08.2017 / 16:23
1
answer

Select with Laravel / Eloquent

I have the following select in my controller: $turmaAlunos = DB::select(' SELECT alunos.ST_ALUNO_ALU, alunos.ID_ALUNO_ALU FROM alunos WHERE alunos.ID_ALUNO_ALU NOT IN ( SELECT turma_alunos.ID_ALUNO_ALU FROM turma_alunos...
asked by 14.08.2017 / 03:48