i have a list with peoples id and date, the list say when a person Entered to website (his id and date). how can i show for all the dates how many people enter the site two days in a row? the data ( …
Selecting the union part of an sql query
I have this query SELECT L.Account, L.PaidOffDate FROM MARS.dbo.vw_Loans L WHERE L.isActive = ‘False’ AND L.LoanStatus NOT LIKE ‘%REO%’ AND L.LoanStatus ‘Trailing …
SQL Server : select first occurrence from two columns
(Edit: I am bound to use Visual Studio 19 and have no rights to install any other application) I have a small SQL table with about 150k rows and 20 columns which I need to modify. I need the table to be ordered by date. I need the first occurrence of a value from two columns. Depending on if the
Trying to get a column from a Subquery
I need to extract information out of 2 Tables. I can’t join them because there is a resource limit for SQL Queries, which is very low. So I came up with following query. This works quite well, but I …
Filter msdb.dbo.sysjobsteps.command into seperate columns
I am trying to split the msdb.dbo.sysjobsteps.command column into separate columns to show the following information: folder project dtx package A small sample of my data is below: I have tried to use the substring method, however I cannot seem to get the starting and ending number of the substring. My aim is…
Way to alter one table if another was altered
For example, I am having table T1 and archive table T1_A Create table T1(n number); Create table T1_A(archieve_dt date,n number); To make activation working correctly if I am adding a column to T1 …
getting error in Sql Query incorrect syntax near ‘)’ [closed]
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed las…
MySQL – ORDER BY multiple words, then alphabetically?
How can I change this part of the query to have multiple words ordered first in sequence, then the rest of the results alphabetically? ORDER BY CASE WHEN name LIKE ‘%Professional%’ THEN 0 ELSE 1 …
SQL `SELECT ‘some string value’ AS fieldname` equivalent in Powershell?
In SQL I can go SELECT actualField, “repeat” AS bs_repeated_value FROM Table1 And I can repeat the bs_repeated_value field as many times as there are rows no matter what I name the field! Now in a …
Using replace() inside a loop
I am trying to copy indexes from materialized views onto tables. This is the script I am trying to use: DO $$ declare indexdefname record; a text; b text; c text; begin for indexdefname in …