简体   繁体   English

从具有不同的其他表中获取所有列

[英]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.我正在做一个不同的过滤2列,但我需要它来给我带来查询的所有列,在这种情况下它只给我带来“idMes”和“idAnio”,我需要它来向我展示其他列出色地。 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 Select *为您提供所有列

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 BQ/SQL 以一种方式连接两个表,其中一个列填充了另一个表中的所有不同值,而其余列则为空 - BQ/SQL join two tables in a way that one column fills up with all distinct values from the other table while remaining columns get a null 如何使用oneColumn上的Distinct和表上的Union来获取所有列? - How to get all columns using Distinct on oneColumn and Union on tables? 来自 2 个不同表的 DISTINCT 列 - DISTINCT columns from 2 different tables 加入2张桌子以获取所有原始数据。 获取所有不同的联接列 - Join 2 tables to get all raws. Get all distinct join columns 连接后如何从两个表中获取所有不同的ID? - How to get all distinct id from two tables after join? 不同的值但获取所有列 - Distinct Values but get all the columns 比较两个表中的所有列并获取更改后的列名称 - Compare all columns from two tables and get the changed columns name Oracle:具有以下内容的表:所有表| 所有栏| 独特的价值观 - Oracle: Table with: All Tables | All Columns | distinct values SQL 从第一列中选​​择所有不同的行,并使用其他列中的随机值 - SQL select all distinct rows from first column with random values from other columns 在几列上使用 SELECT DISTINCT - 但显示表的所有其他列 - Using SELECT DISTINCT on a few columns - but show all other columns of table
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM