当前位置:Gxlcms > 数据库问题 > SQL中distinct的用法

SQL中distinct的用法

时间:2021-07-01 10:21:17 帮助过:27人阅读

select id, distinct name from A;   --会提示错误,因为distinct必须放在开头

5.其他

distinct语句中select显示的字段只能是distinct指定的字段,其他字段是不可能出现的。例如,假如表A有“备注”列,如果想获取distinc name,以及对应的“备注”字段,想直接通过distinct是不可能实现的。但可以通过其他方法实现关于SQL Server将一列的多行内容拼接成一行的问题讨论

 

SQL中distinct的用法

标签:方式   html   href   拼接   tin   www   name   字符   其他   

人气教程排行