Questions tagged as 'query'

1
answer

Select Electronic Point Record (SQL)

How can I collect only the first and last mark, where an official can have X Markings and even markings the next day? As the example below +------+--------+-------+-------+ | FUNC | DATA |ENTRADA| SAIDA | +------+--------+-------+-------+...
asked by 01.09.2018 / 21:35
1
answer

Oracle Relationship Query Query

I have a program to look for records dependencies to proceed with deletion of data here in the company. We support some banks but in Oracle the query is processed very slowly (about 10 to 15 seconds for each table in remote production ban...
asked by 04.06.2014 / 14:18
1
answer

Transform rows into a select column - PIVOT - SQL Server

I have a SQL query that returns the following result: Inquiry +--------------------------------------------------------------------------+ | CONJUNTO | TIPO | FILHO | PAI | TIPO_CONTEUDO | TIPO_DESCRICAO | +---...
asked by 21.09.2017 / 22:32
2
answers

How to use Sum with subquery

How can I use sum with a subquery inside? I tried in many ways, but I could not. When I try to put sum right after the main select , I get the message that I can not use aggregate function with aggregate or query. SELECT SUM(CONVE...
asked by 20.02.2017 / 12:38
1
answer

Full Text Index for Ecommerce Database!

I have read several posts here in the SOPT about creating índices which got me a lot of doubts I had, but my main one is about FULL TEXT ! In a database that is exclusively targeted to ecommerce , where inserts , u...
asked by 13.03.2017 / 13:57
2
answers

Go get the various fields to the query

I have this query: @tudo = Isolated.joins("LEFT JOIN resists ON resists.isolated_id = isolateds.id").joins("LEFT JOIN genes ON genes.isolated_id = isolateds.id LEFT JOIN stats ON stats.gene_id = genes.id LEFT JOIN mutations ON mutations.id = s...
asked by 18.04.2015 / 01:10
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
1
answer

Doubt - SQL Server Query Condition

Galera, in the query below is bringing as follows. But I want you to bring only the 'YES'. The difficulty is because it is a subselect with case. I bring you where? No where or a having? How would it be more or less Current Result Client...
asked by 10.05.2018 / 13:48
2
answers

SQL: Doubt in Relationship between Tables

I'm creating an academic system that consists of a virtual restaurant menu type, so I've created three tables in the database: Menu Items Table: CREATE TABLE ITEMS( ID INT PRIMARY KEY NOT NULL, NOME VARCHAR(20) NOT NULL, DESCRIC...
asked by 05.09.2017 / 13:48
1
answer

Error converting from varchar to smalldatetime

In the query below the following error occurred:    Converting a varchar data type to a smalldatetime data type resulted in a value out of range. By analyzing, I realized that if I take out the dbo.FN_CALC_HORAS_UTEIS function, it...
asked by 13.09.2017 / 15:19