这可能很容易,但不知道怎么做.
I have a table that can have repeated values for a particular non-key column field. How do I write a SQL query using Query Builder or Eloquent that will fetch rows with distinct values for that column?
请注意,我并不是只获取该列,它与其他列值一起使用,所以distinct()
可能并不真正起作用.所以这个问题基本上可以是,既然distinct()
不接受任何参数,如何在查询中指定我想要区分的列?