Row numbers for consecutive dates for a given activity [closed] - sql-server

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 days ago.
Improve this question
I need to return row numbers for consecutive dates for each activity.
enter image description here
I have tried row_number() over(partition by) but cannot seem to get the right row numbers against the consecutive dates for the activity type. This is what I am trying to return:
enter image description here

Related

Convert a Time datatype column with values from hh:mm:ss.ffffff to hh:mm:ss:ff [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 days ago.
Improve this question
On Synapse Analytics how do we - Convert a Time datatype column with values from hh:mm:ss.ffffff to hh:mm:ss:ff
Here are the samples:
Actual
00:00:00.9900000
00:26:10.0200000
00:00:03.9800000
00:22:41.0400000
00:00:00.9800000
00:22:09.0300000
00:00:00.9900000
00:25:34.0200000
00:19:26.9800000
00:03:45.0200000

Address fields to combine with comma , with null check [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 days ago.
Improve this question
Trying to add address fields with comma at the end of the field , but if any one of the field is missing i am getting multiple comma's

Trying to Filter and display last 10 results [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 months ago.
Improve this question
I am trying to retrieve the last 10 mentions of the text that's in cell B8.
For example, if B8 is "Tom Brady", I want to retrieve the last 10 results for Passing Yards (DB:M) that mention Tom Brady.
I got this formula but it displays the first 15 it seems.
=QUERY(DB!B:AZ,"select M where C = '"&B8&"' order by B desc limit 15")
https://docs.google.com/spreadsheets/d/12b9dxeSt4_F9hdgaqDzggNW-fbMyXesWaqT0JjqMVhk/edit?usp=sharing
Any help would be appreciated!
use:
=INDEX(SORT(SORTN(FILTER({D5:D, ROW(D5:D)}, D5:D<>""), 10, 0, 2, 0), 2, 1),,1)

Need help using Regular expression [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 11 months ago.
Improve this question
I want to display the only the highlighted values (They are 9 digits). Can we do this using RegExp?
You can use regexp_substr(column1, '[0-9]{9}'). Below is an example:
select regexp_substr(column1, '[0-9]{9}') nine_digits
from (values
(';**260488570**;1;13.25;20339=22.99')
,('1293=::info::0,;**297100755**;1;2.86;20339=4.49')
,('1293=::info::0,;**338010030**;3;6.71;20339=2.69')
,('1293=::info::0,;**260142941**;1;2.38;20339=4.59')
,('1293=::info::0,;**370039059**;1;2.86;20339=3.79')
);
Result:
COL2
260488570
297100755
338010030
260142941
370039059

How to convert this MS SQL numeric value to a date [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
Should be an easy convert, but cast and convert are failing me.
The value I am trying to convert is: 1509180600
Other examples are 1572256200, 5150938920
I have a very large number of records and many fields where dates have been stored like this. The system is being replaced, which means thankfully, this problem will go. But need to know what the values are before wiping them!
This is probably a Unix timestamp. You can convert it by adding seconds to 1970-01-01:
select dateadd(second, col, '1970-01-01')
. . .

Resources