Questions tagged as 'sql'

1
answer

Change the name of a table in the H2 Database Engine

I'm trying to change the name of a table in H2, but I can not find the syntax. Does anyone know?     
asked by 13.02.2018 / 13:15
1
answer

Consistent sum of a column in SQL

I wanted to calculate the data of a bad table as follows I have a price column    100 140 300 200 I wanted to generate a second column that would make a consecutive sum of the previous table    100 240 540 740 I was able t...
asked by 11.02.2018 / 05:49
1
answer

How to total the number of records per Category using a VIEW SQL SERVER

Good evening. I'm not finding a way to, using or just calling a VIEW, count how many teachers there are in a given category, whose output should be the category and the quantity. The VIEW I made is as follows: CREATE VIEW VMostraProfessor A...
asked by 01.04.2018 / 02:51
1
answer

Removing Duplicates from Two SQL Columns

So the situation is as follows, I have a table and I have three fields in it, so I need to compare the a = b ) and find out if there is anyone else. What's the problem, I'm new in the middle of the sql and I'm not sure if I did it right, I t...
asked by 01.02.2018 / 13:43
2
answers

Create a VIEW or a new TABLE in Postgres?

Hello! I have a situation ... I have a table that will have about 3 * 10 ^ 12 lines (3 trillion), but with only 3 attributes. In this table you will have the IDs of 2 individuals and the similarity between them (it is a number between 0 and 1 th...
asked by 06.03.2018 / 11:55
1
answer

Error creating procedure in oracle

When declaring the name of a procedure in sqldevelope I get this message Erro: ORA-00972: identifier is too long Naming example: PRC_IMVW_TISS_VERIFICA_ELEGIBILIDADE CREATE OR REPLACE PROCEDURE PRC_IMVW_TISS_VERIFICA_ELEGIBILIDADE AS...
asked by 19.01.2018 / 20:24
1
answer

SQL account how to do sum and subtraction

I'm starting to learn SQL need to make an account, I have a select for a report where I need to make an account to show another value in the fields of that report and formula can not appear on it. Query: SELECT application_name,...
asked by 23.03.2018 / 12:31
3
answers

How to select only the largest move in Sql?

I'm in need of some help finding the latest inventory of each product. It turns out that in the clause I made, it is returning all the sales related to that product, being that I only need the last one ... The sales are ordered by id. I've made...
asked by 23.03.2018 / 16:37
1
answer

Convert SQL to LINQ

I have the following table CREATE TABLE 'ultimaposicaorastreadores' ( 'Id' CHAR(36) COLLATE utf8_bin NOT NULL DEFAULT '', 'Serial' BIGINT(20) NOT NULL, 'DataGps' DATETIME NOT NULL, PRIMARY KEY USING BTREE ('Id', 'DataGps'), KEY 'serial_idx' US...
asked by 11.01.2018 / 17:32
1
answer

Select to count amount per column

How do I make a select that returns the number of repeating devices, and the first and last date of these records? Equipamento | Data | Causa | B 01/01/2017 x B 03/04/2017 Y A 05/0...
asked by 10.01.2018 / 11:31