简体   繁体   中英

Get all columns from other tables with a distinct

I am doing a distinct to filter by 2 columns, but I need it to bring me all the columns of the query, in this case it only brings me "idMes" and "idAnio", I need it to show me the other columns as well. How could I do it?

this is my sentence:

SELECT DISTINCT e.idMes, e.idAnio FROM expensas as e INNER JOIN anios as a on e.idAnio = a.idAnio INNER JOIN meses as m on e.idMes = m.idMes;

Select * gives you all columns

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM