Viewing 9 posts - 46 through 54 (of 54 total)
There are other methods, with less use of date functions. If uahmed90 provides CREATE TABLE statement and some reasonable test records, we could try another approach.
August 31, 2021 at 8:38 pm
Good idea would be to leave "the lookup" to the SQL server, then pass the results to C# code. Something like:
SELECT ID, NAme FROM DirectoryTable
WHERE ID...
August 31, 2021 at 8:11 pm
Ravi77, you may bi in bigger trouble than it seems.
In any case, you need to figure out what makes each table unique, does not have to be just one column....
August 31, 2021 at 8:01 pm
Function coalesce() should also do the job. In this example, I assumed that order of using dates for sorting is LastReplied, IncidentDate, CreatedDate. I also reordered columns to my liking...
August 31, 2021 at 7:49 pm
Not directly about coalesce, but since we are also talking about ways to concatenate rows, worth checking is a relatively recent addition to T-SQL functions is string_agg (expression, separator) . ...
August 18, 2021 at 7:53 pm
ROW_NUMBER in DESCending order, cool trick. Thank you SoCal_DBD. In spite being a newbie, I knew about this one, but hesitated to apply it due to possible slow execution. Live...
August 18, 2021 at 6:56 pm
Be careful with dates. Expression
>= @StartDate AND < @EndDate --- this will miss all rows within @end date
>= @StartDate AND <= @EndDate --- this...
August 18, 2021 at 6:35 pm
I haven't been on SQL.Central for a long time, so i just noticed the post.
Not sure if this is the simplest solution, but for sure is the shortest for typing:
August 18, 2021 at 6:15 pm
This is INNER JOIN. In distant past, SQL did not have JOIN keword, so people used WHERE block to specify both JOIN condition and filters. Your statement would look like...
March 5, 2020 at 1:34 am
Viewing 9 posts - 46 through 54 (of 54 total)