How to use in my application a SELECT statement that must return more than one record to show multiple values for a certain field (m:m relation)

前端 未结 3 1698
长情又很酷
长情又很酷 2021-01-27 10:50

I don\'t know if you got what I mean, but I\'ll try to explain it with an example.

Users Table

UsedId    UserName
--------  ----------
1         Mike
2           


        
3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-27 11:18

    You have ASP.NET and C# in your tags. Considering that what you intend to do is a presentational issue, do it in the presentation layer (i.e. with C#) and not in the data layer (i.e. with SQL). That's a lot easier, too.

    For example, like shown here: Use LINQ to concatenate multiple rows into single row (CSV property)

提交回复
热议问题