Announcement

Collapse
No announcement yet.

Combine SQL results which have same value

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Combine SQL results which have same value

    Hi,
    I'm trying to create a query to query year values, which works. The only problem is I only want to return or combine all similar year values as one rather than related to their actual records. For example multiple records contain the year 2014 so I want the result only to show one value of 2014.

    If I group and order by I still get multiple 2014 values in the results

    SELECTsubstring(Path,12,4)

    FROM [DB].[dbo].[Projects]

    Where [Path] like'\XXX%'

    AND [Deleted] ='0'

    GroupByPath

    OrderbyPath

  • #2
    Sorry guys - me jumping the gun again. Select distinct works a treat

    Comment

    Working...
    X