sql server - sql select 3 columns and dedupe on two columns -


I have a job setup that currently does not have a unique index that selects records from a table I it can only be solved by adding an index on the table and a variety of columns, but for testing purposes in this case, I have to delete the index and then select one which will also remove duplicates based on two columns:

  SELECT DISTINCT [author], [pubDate], [dateadded] FROM [feeds] [Dbo]. [Social Post] Where Cast (False (dateadded as float) datetime) & gt; DATEADD (DAY, DATEDIFF (DAY, 0, GETDATE () - 2), 0) and CAST AS Dettaim (Flo (CAST (on a basket float))) & lt; To DATEADD (DAY, DATEDIFF (DAY, 0, GETDATE ()), 0)   

selects all records from the first day and I lose the record by author and pubdate This post can be selected or done before, but it is to find out that it can be done within a selection.

You can use GROUP BY and an author You can use any of the functions on the dated column to get the message, pubadet results.

Comments