Skip to content
Advertisement

Tag: sql-server

Retrieve rows where Column1 != Multiple Values from Column2

I have 2 Location columns. I need to find a way to show only exceptions, where Location1 != Location2, BUT there are multiple values in Location2 column that can be associated with value in Lcoation1. For example: San Diego in Location1 column can have 4 possible values in Location2 column (North, Central, South, San Diego) and such rows need to

Count rows between time periods excluding time-overlap

I have a table where it holds some vehicle events, I need to count the number of event occurrences every 5 minutes. Sample : I was able to get the results by the following query : query results : The issue with the above results is that the query excluded Ids (15 and 28) the correct output should be :

Convert List Of XML Tags in varchar column to comma separated list

I have a table that contains a list of xml tags/values that I need to use to join to another table to retrieve their actual value and display the result as a csv list. Example varchar data: However, these values actually translate to other values: red, white, blue respectively. I need to convert that list to the following list: As

Advertisement