Questions tagged as 'sql'

1
answer

Return range of Oracle PL / SQL strings

Good morning! I need to return the value inside a string that is between a range of | in the select below I can get the value from the first | . The expected result is: 83,1 SELECT SUBSTR('1410,00|83,1|39,29|1410m|',...
asked by 19.07.2018 / 13:16
2
answers

How to avoid invalid date error in a subquery

In the code below, the "D" subquery returns only valid dates in the DAY column, however, when you try to filter that column by using the WHERE clause, Oracle displays the following error message:    "ORA-01839: The date is not valid for the s...
asked by 21.06.2018 / 16:52
1
answer

Creating Table / BD with Django?

I use python 3.4 and the latest version of django, I am using the "python manage.py sqall" command but it does not recognize the sqall command. (I am trying to create a table in Bd, and already enter the data correctly.)     
asked by 21.06.2018 / 19:12
2
answers

How to write SELECT result?

I need to insert data into a table A, but I have an unknown data and I need to search it in table B. So, I need to do a SELECT on table B and save it for later insertion into table A. I have achieved the expected result, but it is a pallia...
asked by 09.01.2015 / 19:43
1
answer

Write only one field in the database

How do I save only one of the fields of this select ? Statement stmt = con.createStatement(); ResultSet RS = null; RS = stmt.executeQuery("select codplpag, descricao from pcplpag ORDER BY 1,2"); while(RS.next()){ // ListaBox.add...
asked by 08.01.2015 / 19:18
1
answer

Error when modifying column of a View with calculation

I need to insert a calculation column in this view below, but the message    Msg 205, Level 16, State 1, Procedure ConsolidatedStudyBaseSifix, Line   4 [Batch Start Line 9] All queries combined using a UNION, INTERSECT   or EXCEPT operator mu...
asked by 06.09.2018 / 17:35
1
answer

Sum (SUM) of a column with irregular formatting

In my MySQL table I have a column called "weight". This column has the following values: 19.325 14.369 15.325 15.369 17.698 19.258 18.098 I simply need to do the sum, but when I run select sum(peso) from tabela it returns me the valu...
asked by 18.06.2018 / 15:58
2
answers

Rails - check for non-matching records

I have a Rails application and I'm creating a notification system, the problem is that I do not know how to query for notifications not seen by a user in a practical way. The schema of the notification table is as follows: create_table "not...
asked by 18.06.2018 / 20:41
1
answer

Trigger gives error with date

I did a trigger to count the weekdays. It accepts the dates of month 06 very well, but other dates gives the following error: INSERT INTO 'teste' VALUES ("2018-05-01") #1292 - Incorrect date value: '20180532' for column 'i' at row 1 Trigger...
asked by 29.06.2018 / 22:32
1
answer

Maximum SQL data

I have the following table T_PGTOS_ADESAO : Adesão | Tipo Adesão | Data Vencimento Boleto | Data Pgto Boleto 12247 | Cartão | 20-03-2018 | 03-03-2018 38497 | Boleto | 15-05-2018 | 10-05-2018 48289...
asked by 14.05.2018 / 22:52