Posts by rammonzito • 498 points
27 posts
-
2
votes1
answer271
viewsA: How can I "Update-Migration" vscode?
I believe you can do this using the command on the terminal: dotnet ef migrations add NomeDaMigration and to update: dotnet ef database update…
-
3
votes3
answers60
viewsA: Copy row to identical table - mysql
You need to be very attentive to the field you will use as a key, as you may end up updating all rows of the backup table and apparently it is not what you want. I used temporary tables to…
mysqlanswered rammonzito 498 -
1
votes2
answers413
viewsA: SQL Server - calculate number of word occurrences in a column, per record
Renata, I made some adjustments to use locally. You will need to change the table used, but this is simple. You can use it as follows: DECLARE @conteudo_dcm TABLE (DCM_id INT IDENTITY(1,1),…
-
0
votes4
answers405
viewsA: Search a specific line in a . txt file and change the content
Gabriel, your question is a little confused or you don’t have enough information. Anyway I interpreted and made a simple code that searches if the CPF is contained in the file. For tests just put…
-
2
votes2
answers342
viewsA: Use of the unassigned local variable of two strings in C#code
The error is occurring because the variables do not have initialization (initial value defined). Simply assign a value to them as an example below: string sexo = ""; string pessoamaispesada = "";…
-
0
votes2
answers1348
viewsA: error while doing git push
Try git commit -m "primeiro commit" and then try git push -u origin master again. For more information take a look here. I hope I’ve helped.…
-
0
votes1
answer108
viewsA: How to make a Mysql SELECT by summing values of several Ids from a table?
You need to use GROUP BY for the sum to occur according to each payment method. Example: SELECT SUM(r_entradas.entrada_valor) AS Valor, c_forma_pgto.forma_nome AS Forma FROM r_entradas INNER JOIN…
mysqlanswered rammonzito 498 -
2
votes3
answers264
viewsA: Select Group by Month
Just insert MONTH in the SELECT, gets like this: SELECT MONTH(dataVen), SUM(valorTotal) AS valorTotal FROM cad_cr2 GROUP BY MONTH(dataVen)…
-
2
votes3
answers237
viewsA: Query SQL Add duplicate value
Hello! You can use Function SUM(), grouping by the Barcode.bar column. Next: SELECT CODIGO_BARRAS.barra, SUM(produtos_eventos.quantidade) AS QUANTIDADE FROM PRODUTOS_EVENTOS, MOVIMENTO,…
sqlanswered rammonzito 498 -
0
votes2
answers189
viewsA: IF with 2 distinct variables for various scenarios
<?php if($Telefone == "" && $Celular == ""): echo "Sem contato"; elseif($Telefone != "" && $Celular != ""): echo "Telefone:".$Telefone."Celular:…
-
0
votes3
answers140
viewsA: GROUP BY last registration per month and year how to do?
You can do this using an auxiliary temp table: --tabela fake /* DECLARE @TABLE TABLE (ID INT, Valor FLOAT, Mes INT, Ano INT) --valores fake INSERT INTO @TABLE VALUES(1, 39.69,3, 2017) INSERT INTO…
-
0
votes3
answers551
viewsA: Convert string to integer positions
Using Linq and Generic you can do this in a simple way: using System; using System.Collections.Generic; using System.Linq; namespace valor_posicao_string { class Program { static void Main (string[]…
-
1
votes5
answers459
viewsA: Concatenate id by description into an array in javascript
I believe you need something in that direction (running): var groups = {}; for (var i = 0; i < variavel.length; i++) { var groupName = variavel[i].descrição; if (!groups[groupName]) {…
-
0
votes2
answers267
viewsA: SELECT DATE column for HH24:mm:ss
Hello! I believe this example can help you: SELECT last_name, employee_id, hire_date FROM employees WHERE EXTRACT(HOUR FROM TO_DATE(hire_date, 'DD-MON-RR')) = 10 Follows link of documentation. In…
-
0
votes1
answer244
viewsA: Store the contents of a file in another - python file
Hello! I believe that you need to use global variables in another way and another point would be with respect to writing in the file (each with its own responsibility). follow code running: import…
-
1
votes2
answers98
viewsA: Access Restriction with Classic ASP
I believe that you should check whether the user is contained in the table or not, rather than only consisting of the query return. I am considering that there is a LOGIN field in the table. If it…
-
1
votes4
answers6021
viewsA: How to create a function to find the highest value in a list?
You can use your own max() to do this. Example: list_1, list_2 = [123, 'xyz', 'Rafinha', 'abc'], [325, 600, 199] print "Max value: ", max(list_1) print "Max value: ", max(list_2) #Max value: Rafinha…
pythonanswered rammonzito 498 -
1
votes3
answers42
viewsA: How to simplify these two methods?
Hey, buddy! You can include a new parameter in the method and perform the operation according to its value. Example: def __action__(self, other, mat_operation): if other.__m == self.__m and…
-
1
votes1
answer26
viewsA: Group By show when not in the table
Hey, buddy! You can do this in two ways. Example: SELECT * FROM usuario_cor t1 WHERE t1.Tipo = 'azul' AND NOT EXISTS (SELECT TOP 1 1 FROM usuario_cor t WHERE t.ID_usuario = t1.id_Usuario AND t.tipo…
-
0
votes1
answer59
viewsA: Conditions different from the same column
You can use the following instruction: SELECT * FROM anuncios WHERE (finalizar = 'N' OR (finalizar = 'S' AND datafim <= GETDATE()))
-
1
votes2
answers114
viewsA: doubt to consume api
Got it. If you want it synchronously, you don’t need to call Wait(), just return Result directly. The result blocks the call thread until the task is completed. In this case, until the post is set,…
-
0
votes2
answers114
viewsA: doubt to consume api
Hello, friend! Your API is in an X url and you need to make it clear in the code. Example: req.BaseAddress = new Uri("http://localhost:5000/"); //para uma api com esse caminho.…
-
0
votes1
answer22
viewsA: index has to refer to a coordinate of a string
Hello, Friend! I believe you need to use the Stringbuilder. Below is the code with the setting: using System; using System.Collections.Generic; using System.Linq; using System.Text; using…
substringanswered rammonzito 498 -
2
votes3
answers3588
viewsA: How to store more than one value in an "SQL variable"?
Hey, buddy! I believe the easiest way to do this is by using string concatenation. Below is an example applying to your need: DECLARE @UNIDADE VARCHAR(100) = '' SELECT @UNIDADE += UNIDADE + ', '…
-
4
votes3
answers1697
viewsA: Remove 2 specific characters from a String
Hey, buddy! You can use the Decimalformat.Example: Double price = 5.000; DecimalFormat format = new DecimalFormat("0.#"); System.out.println(format.format(price)); I hope I’ve helped. Hugs,…
-
0
votes1
answer74
viewsA: MYSQL, How do SELECT without grouping identical WHERE values?
Hey there, buddy boy! I believe you need to use UNION and structure your SELECT as an example below: Mysql Instruction SELECT id, descricao FROM Produtos WHERE id IN (1) UNION SELECT id, descricao…
-
2
votes4
answers2768
viewsA: How do I enter a value in every record in a column of a table?
Mysql Instruction: UPDATE Categoria SET Campo = 3 This causes all values in the "Field" column to be changed to "3". If there is a need to do this for specific lines, the use of a conditional…