I was trying to make a query which should concatenate a year and month so I could filter my data.
i.e. “201106” should be created for year 2011 and month 6, which I receive as parameters. Since I needed the month as a 2 digit I used the to_char function with a format as follows
which produces “2011 06”, it adds an empty space at the beggining -the explanation is here–
You should do it like this
I ended up using another function, lpad