Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I have an A table in a warehouse. I want to query the table as follows:
Is it possible to query a subquery? How can I get distinct values and then get them as a string separated by ','?
Solved! Go to Solution.
Hi @amaaiia @can you try putting your select in a CTE:
;with distinctdata
as
(
select distinct field1 from [lakehouse].[schema].[table] where field2='value2'
)
select STRING_AGG(field1, ',') from distinctdata
Hi @amaaiia @can you try putting your select in a CTE:
;with distinctdata
as
(
select distinct field1 from [lakehouse].[schema].[table] where field2='value2'
)
select STRING_AGG(field1, ',') from distinctdata
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Fabric update to learn about new features.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |