3-Oxoalkanenitriles 1a-d were obtained in high yield by treating enaminones 6a-d with hydroxylamine hydrochloride and stirring the resulting oxime with diethyl oxalate. The formed 3-oxoalkanenitriles 1a,b readily undergo self-condensation to yield 2-aroylanilines 3a,b on heating in pyridine for eight hours or by irradiation in microwave for 1.5 minutes. In contrast, 1c-e were recovered unreacted under similar conditions. Pyrolysis of 3-aminocrotononitrile 14 produced a mixture of the aminopyridine 16, 19, and aminobenzene 22. Heating 14 in aqueous media has resulted in formation of the pyridine 20, while heating the same compound in acetic acid has afforded pyridone 20 and acetyl pyridine 24.