(Adds investor quotes and details throughout, updates prices))

* TSX ends up 101.20 points, or 0.5%, at 21,188.19

* Financials advance 0.6%; industrials end up 1.6%

* Canadian National Railway gains 5.2%

* Energy group rises 0.4%; crude oil settles 1.1% higher

TORONTO, Oct 20 (Reuters) - Canada's main stock index rose on Wednesday to a record high, as Canadian National Railway led gains in industrial stocks and resource shares benefited from higher commodity prices.

The Toronto Stock Exchange's S&P/TSX composite index ended up 101.20 points, or 0.5%, at 21,188.19, a record closing level.

"The sectors that have held back the TSX for the last few years are finally starting to work," said Greg Taylor, a portfolio manager at Purpose Investments.

"We have got energy coming out of the doghouse, we've got materials working and the banks are finally starting to play some catch-up."

The energy group rose 0.4% as oil prices rose, with U.S. crude oil futures settling 1.1% higher at $83.87 a barrel.

Copper and gold prices also rose, boosting the materials group.

The heavily weighted financials group advanced 0.6%, while industrials ended 1.6% higher, helped by a 5.2% gain for Canadian National Railway Co after the company said its chief executive will retire at the end of January and reported quarterly earnings that beat estimates.

As long as conditions supportive of cyclical stocks continue to work, "the TSX should have a good run here and might be able to outperform the S&P 500 for a while."

Since the start of the year, the TSX has advanced 21.5%, while the S&P 500 is up 20.8%.

One risk to the outlook is rising inflation pressures, with data showing that Canada's annual inflation rate accelerated to an 18-year high in September.

"Canadian inflation pressures continue to increase adding pressure on the Bank of Canada to potentially take additional action on reducing stimulus when it meets next week," said Colin Cieszynski, chief market strategist, SIA Wealth Management. (Reporting by Fergal Smith; Additional reporting by Amal S in Bengaluru; Editing by Peter Cooney)