I have a problem making a simple selection of a date. I commented:
I want to collect the month of the creation of a file and that is ordered by the date with this sentence:
select to_char(fecha,'MONTH') as MES from archivos order by (fecha) asc;
The problem is that there are several files created the same month and it shows me this:
SEPTIEMBRE
SEPTIEMBRE
OCTUBRE
OCTUBRE
NOVIEMBRE
DICIEMBRE
DICIEMBRE
DICIEMBRE
DICIEMBRE
ENERO
I just want one month to go out, not all of them. I found something about the select distinc
but it gives me an error ... I also think that it can be done with group by
.
I've also tried with distinc
select distinct(to_char(fecha,'MONTH')) as MES from hph_weekly order by fecha asc;
but I get this error:
01791. 00000 - "not a SELECTed expression"
Can someone help me?