Posts by user2332849 • 246 points
10 posts
-
7
votes2
answers59
viewsA: How to gradually transform n number generation in normal distribution in R
You see, if you start with the value 100 and gradually increase to 1000000 by a gradual addition, say 20 to 20, you will not "ever" to 1000000, because that is a lot of steps. What you need is a…
ranswered user2332849 246 -
1
votes1
answer336
viewsA: How to compare characters from an external file to the ASCII table in C?
The problem is that you read the end of file (EOF), test whether the character is inside the table or not, and only then test you should finish the loop (c != EOF). It would make no sense to test…
canswered user2332849 246 -
0
votes1
answer28
viewsA: Doubt in the use of Dateformat in linked server (Linked)
You are setting the date in month/day/year format. We know this because the first component is 12 (obviously December), the second component is 31 (the last day of December), and the third is the…
-
0
votes1
answer40
viewsA: Convert char to date - Hive
cast( substr(dt_atendimento_fcdr, 1, 4) || '-' || substr(dt_atendimento_fcdr, 5, 2) || '-' || substr(dt_atendimento_fcdr, 7, 2) || ' ' || substr(hr_atendimento_fcdr, 1, 2) || ':' ||…
-
1
votes1
answer105
viewsA: Filter columns conditionally to another column
If I understand correctly, you want, for each row of the table, a cumulative sum for that row. That is, for the first line, you want the sum of JM from 1 to 204. For the second line, the sum of JM…
-
1
votes1
answer36
viewsA: How to insert multiple Rows, where some Rows will have fewer values than columns
There is no syntax for inserting multiple lines, where one line affects certain fields, and another line affects other fields. Each INSERT must specify the columns to be inserted, and all values…
-
0
votes1
answer36
viewsA: Unrealized/ subquery failing
Hello The subquery in SELECT can/should only return 1 record, so you should always put "TOP 1" on it, and an "ORDER BY" clause to tell you what your criteria is for a first record. "Inner Join…
-
0
votes1
answer669
viewsA: Add values from previous line to next
You need to use the window functions (window functions) to make a cumulative sum. They are available in SQL Server as of 2012. To do with an earlier version, you will get a little more work. The…
sqlanswered user2332849 246 -
0
votes1
answer215
viewsA: How to recur SQL server using WITH to return all children
Hello, expressions using WITH are called CTE’s (Common Table Expressions). You need a recursive CTE. You have done well the union of two queries with UNION. 1) What you need is for the first UNION…
-
0
votes2
answers300
viewsA: How to create a data frame of a database based on the difference of two dates in a column of another categorical variable in the R software
Another way to do this is by using the dplyr package: library(dplyr) dados <- tribble( ~Grupo, ~Data, "A", "01/02/2017", "A", "15/02/2017", "A", "20/03/2017", "B", "18/02/2017", "B",…