Posts by ricidleiv • 2,267 points
34 posts
-
0
votes1
answer251
viewsA: To repeat the value of a field in another field in select SQL Server
If I understand your question, you want to bring the father’s name along with the person’s name. For this, you can use a LEFT JOIN of the Person table with itself, relating the records where the…
-
1
votes1
answer98
viewsA: Go to the next row of a table with while. Is it possible?
Without using a cursor, you can use the ROW_NUMBER() strategy and filter the line with each iteration according to the value of @Count. This way, you would need to change the SELECT behind the…
-
3
votes1
answer191
viewsA: Select with Search conditions
You need to specify the order in which the criteria will be evaluated using the (), as @rray commented. SELECT * FROM users WHERE (user LIKE :search OR date_access LIKE :search OR ip LIKE :search )…
-
2
votes2
answers2421
viewsA: How to compare the values of one interval with another, following a formula?
You can use the formula SOMA with the formula SE, using the vector resource. In this case, to count the number of rows that meet the criterion "The number of complete laps must be less than 35% of…
-
1
votes3
answers372
viewsA: List dates calculated per month based on parameters
You can use a recursive CTE to generate the date list of the period and then filter the dates that correspond to the same day of the week and the week number in the month is the same as the start…
-
1
votes2
answers1056
viewsA: Query for MYSQL with IF to validate several table fields
A possible solution is to consider a default value when the variable is not selected in the application. For example -1. SELECT type, property_type, city, region, neighborhood, price, rooms,…
-
1
votes2
answers1148
viewsQ: How to change the return url when directing to the login page?
How can I change the value of ReturnUrl passed to the login page when the user is on a specific page and the session expires? For example, if the user is on the page www.meusite.com/seguranca.aspx…
-
8
votes5
answers32771
viewsA: How to calculate the age of a person with JS, from the date of birth?
A one-line solution, calculating from the number of days: // calcula a idade considerando os parâmetros // 'nascimento' e 'hoje' como objetos Date function calculaIdade(nascimento, hoje){ return…
javascriptanswered ricidleiv 2,267 -
3
votes5
answers620
viewsA: How to select records that have a relationship with all values in a list?
Use a subquery in the clause WHERE whether the person possesses the requisite qualifications. SELECT cp_pessoa.id, cp_pessoa.nome FROM cp_pessoa WHERE -- Se a pessoa possuir ao menos as habilitações…
-
0
votes5
answers508
viewsA: Query error with WHERE AND COUNT on Oracle. "SQL command not properly ended"
For conditional insertion in Oracle you can use the clause MERGE MERGE INTO TB_CLASSIFICACAO_UG USING (SELECT COUNT(TXT_DESCRICAO) AS count FROM TB_CLASSIFICACAO_UG WHERE TXT_DESCRICAO = 'TESTANDO')…
-
3
votes3
answers2597
viewsA: How to write commands in a console program through a batch (.bat) file?
You can direct inputs as follows: ( echo mget %0 echo quit ) | ftp 111.222.333.444 However, please refer to your program’s documentation if it allows some execution parameters. It may accept a list…
-
3
votes2
answers2614
viewsQ: How to get the index creation date in SQL Server?
By SQL Server Management Studio I did not find in the properties of an index its creation date. How can I get the creation date of a specific index by just referring by name?
-
3
votes1
answer1212
viewsA: Is it possible to create a Rigger that invokes a web service?
Getting only on the merits of the web service invocation issue from a Rigger, there is this article in English. The logic is to use the Procedure sp_OAMethod which allows calling a method from an…
-
2
votes3
answers763
viewsA: How to list the results of a regex search in a directory?
I came to the following command: PS> select-string -path *.cs -pattern "(?smi)(?<sql>SELECT .+?);" | foreach {$_.matches} | foreach {$_.groups['sql']} | select value But it returns the…
-
9
votes3
answers763
viewsQ: How to list the results of a regex search in a directory?
I have a directory with some C#files. In these files there are several SQL query codes. I need to list all SELECT commands in these files using Powershell. The commands start with SELECT and end…
-
2
votes4
answers3090
viewsA: Regex for Cifras site as Cifraclub
The following Xpath code returns all page ciphers. //pre[@id='ct_cifra']/b/text() Just adapt it to the language you are using. To test it, in your browser’s JS Console, use the following expression:…
-
5
votes1
answer550
viewsQ: How do I validate an email field on Dart?
I created a simple project in Dart whose intention is to validate an e-mail field when a button is clicked, showing an error message. However, the function Regexp.hasMath is always returning false.…
-
1
votes2
answers210
viewsA: How to change a query so that it is executed for each row of table X?
One possibility is to use a CURSOR. Below is an example of how your code could be implemented using a Cursor within a PROCEDURE. -- Não testado DELIMITER $$ CREATE PROCEDURE insert_tb_eshop() BEGIN…
-
6
votes1
answer806
viewsQ: How to get values from a column of multiple tables displayed on a web page?
On a web page, there are one or more tables with information that I need to get in the form of a list. Specifically, I need to get a list of the values of the 2nd column of a table of the web page I…
-
19
votes1
answer11373
viewsQ: How to use a specific index in a SQL Server query?
I have a non-standard table in SQL Server installed on my PC which is fed monthly by Integration Services (SSIS) from a report in an Excel spreadsheet. I mean, I’m keeping track of a certain report.…
-
5
votes3
answers2176
viewsQ: Command to replace characters recursively
I need a command that overwrites a specific pattern on each line of a file as many times as necessary until the pattern is no longer found. For example, in a CSV file, fields are separated by a…
-
1
votes3
answers2176
viewsA: Command to replace characters recursively
The command sed Linux allows working with labels, useful for working with recursiveness. For example, it can be used as follows: $ sed -e ':loop' -e 's/;;/;\\N;/g' -e 't loop' -e 's/;$/;\\N/'…
-
11
votes7
answers4242
viewsQ: How to reset CSS formatting?
It was not uncommon to go through situations where the browser itself interferes with the stylesheet by adding defaults parameters such as margin size and headers fonts, default line height. Is…
-
2
votes7
answers4242
viewsA: How to reset CSS formatting?
This could be a starting point. /* http://meyerweb.com/eric/tools/css/reset/ v2.0 | 20110126 License: none (public domain)*/ html, body, div, span, applet, object, iframe,h1, h2, h3, h4, h5, h6, p,…
-
5
votes3
answers1314
viewsA: How to get around bad rendering of a font in Internet Explorer?
Only using a image to have the same result in any browser and operating system. How the text is rendered in the browser depends on several factors such as operating system, calibration and rendering…
-
1
votes2
answers603
viewsA: How to get the identity of an object in Javascript?
You can add global functionality to the type String: String.prototype.hashCode = function(){ var hash = 0; for (var i = 0; i < this.length; i++) { var character = this.charCodeAt(i); hash =…
javascriptanswered ricidleiv 2,267 -
8
votes2
answers461
viewsA: Writing conventions for ASP.NET controls
Is there any writing convention for ASP.NET controls? Microsoft has a writing convention for its languages. Naming Guidelines - . NET Framework 4.5 This documentation recommends: Use Pascalcasing…
-
10
votes1
answer15267
viewsQ: How to generate a full value in Portuguese in MS Office Excel?
In an Excel spreadsheet, having a cell with a numerical value, how to calculate its value in full? For example, in the cell A1 have the value R$ 587,32. I need a function that passes the cell as…
-
9
votes1
answer15267
viewsA: How to generate a full value in Portuguese in MS Office Excel?
Below is a VBA function that returns the full value of a number passed as parameter, in addition to allowing some return settings. ' Função que retorna valores por extenso ' Params: ' Num (Double) :…
-
8
votes3
answers3242
viewsQ: How to get the last date of a day of the week in a given month in SQL Server?
Using the T-SQL language of SQL Server, how to get, for example, the latest wednesday of the month of May of a given year?
-
2
votes1
answer860
viewsA: SSIS loading entire XML before you start writing to SQL Server
The XML Source does not read the whole document, but rather an element of the hierarchy described in XSD. Ensure that the document contains a single root element, as documented in XML Source - at…
-
16
votes2
answers15027
viewsQ: How can I refer to the heaviest queries in SQL Server?
In the SQL Server database, how is it possible to know which queries have consumed the most resources of the database in its execution?
-
11
votes3
answers1559
viewsQ: How to condition the insertion of a record in SQL Server?
How can I condition the insertion of a record in a table in SQL Server using the T-SQL language considering the following rules: If the record to be inserted already exists in the table, only update…
-
33
votes8
answers48170
viewsQ: How to calculate a person’s age in SQL Server?
Suppose the table Pessoa and the countryside DataNascimento. In an SQL query, what is the best way to calculate a person’s age in integer format in the T-SQL language of SQL Server?…