Questions tagged as 'sql'

1
answer

Crystal Report with LEFT JOIN and WHERE

I have a problem making a LEFT JOIN in Crystal Reports. From what I've researched, it's a classic SQL problem when using WHERE criteria by crossing LEFT JOIN . I tried to solve it anyway, but I could not. There are 4 related tables: [Orc...
asked by 04.12.2014 / 18:43
1
answer

Total sum of values for all dates

How do I add X values to a specific date and compare if the value added is greater than 100? /* Data das consultas, e para cada data o somatório total dos valores, desde que este total seja maior do que 100.00. */ SELECT c.data AS 'Data...
asked by 03.12.2014 / 19:03
5
answers

Error in query with WHERE AND COUNT in Oracle. "SQL command not properly ended"

I have the following query: INSERT INTO TB_CLASSIFICACAO_UG (COD_CLASSIFICACAO_UG, TXT_DESCRICAO, IND_ATIVO) VALUES (SEQ_COD_TB_CLASSIFICACAO_UG.nextval, 'TESTANDO', 1) WHERE (SELECT COUNT(TXT_DESCRICAO) FROM TB_CLASSIFICACAO_U...
asked by 07.02.2014 / 13:44
1
answer

Pages of JPA queries

I am changing the code of a query because it will return a lot of data when the database is well populated. I'm paging the query. The problem is that when they implemented it, they did the following: You get a string, and you make all possibl...
asked by 03.02.2014 / 12:25
4
answers

How do I create a sql view with more than two tables?

How to create a view sql , I need to get the name and password in the Magento DB that are in different tables, to authenticate in Moodle.     
asked by 03.02.2014 / 13:28
2
answers

Query does not work inside php [closed]

I made a query with a join to get information from the database, I tested it in mysql and it worked perfectly, the problem is that it does not work in php, not the execution error but the return is nullo, even if I change the I have used var_dum...
asked by 06.11.2018 / 03:37
1
answer

Bring "child" records count next to all table records

How do I count how many "children" that row has, and at the same time list all records in the table? I have the categorias table, with the following data: _________________________________ | id (PK) | nome | id_pai (FK) | --------...
asked by 11.03.2015 / 15:52
1
answer

Sql Groovy, pass the value of an IN parameter

I have the following code: def pessoaIds = [1, 2, 3, 4, 5] def query = "SELECT * FROM Pessoa WHERE id IN(?)" def pessoaList = sql.rows(query, [pessoaIds]) In this case "PersonList" returns an empty list; def query = "SELECT * FROM Pessoa...
asked by 16.03.2015 / 17:29
2
answers

Doubt with group by - sql

I have these tables: CREATE TABLE empresa ( id_empresa INT, nome_empresa VARCHAR(40), razao_social VARCHAR(40), PRIMARY KEY ( id_empresa ) ); CREATE TABLE departamento ( id_departamento INT, id_empresa...
asked by 03.10.2018 / 20:31
0
answers

Add comment or column with entity framework core fluent api

How do I add a comment to a column. In sql I do this: ALTER TABLE Tabela MODIFY COLUMN 'nome' varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'Teste' AFTER 'nome'; What do I do in entity framework core fluent api?  ...
asked by 12.11.2018 / 15:24