---
title: "Discussion on \"SQL Tips and Tricks\" | Hashnode"
description: "Discussion on \"SQL Tips and Tricks\". Scenario when we need to filter specific select cases with joins\n\nSELECT DISTINCT ProgramID\n,STUFF((\nSELECT '|' + t1.TrancID\nFROM @TBL_ReportColumns T1\nWHERE T1.ProgramID = T2.ProgramID\nFOR XML PATH('')\n), 1, 1, '') AS TransactionCode\n--,trancName,tr..."
url: "https://hashnode.com/posts/sql-tips-and-tricks/647dd5caa39adef705d5b7c0"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [SQL Tips and Tricks](https://rohit36a.hashnode.dev/sql-tips-and-tricks?utm_source=hashnode&utm_medium=feed)

Scenario when we need to filter specific select cases with joins SELECT DISTINCT ProgramID ,STUFF(( SELECT '|' + t1.TrancID FROM @TBL\_ReportColumns T1 WHERE T1.ProgramID = T2.ProgramID FOR XML PATH('') ), 1, 1, '') AS TransactionCode --,trancName,tr...

Jun 5, 2023 · 3 min read · rohit36a.hashnode.dev  
Read the article

-   [#sql](https://hashnode.com/tag/sql)

## Written by

[Rohit Varma](https://hashnode.com/@rohit36a)

@rohit36a

  
[View profile](https://hashnode.com/@rohit36a)

dev

Passionate developer who contributes and wishes to help and empower people

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
