I would like to show the subsection headings for some, but not all subsections. I found \tableofcontents[hideothersubsections], which will hide the subsections for other sections, but I am not in the section I would like to display so this would fail to display subsections I would like to display. In short, I would like to be able to name a section and hide the subsections for that section in the table of contents.

Will a manual approach do?

\documentclass{beamer}

\begin{document}

\begin{frame}
\tableofcontents[sections=1,hidesubsections]
\tableofcontents[sections=2]
\tableofcontents[sections=3,hidesubsections]
\end{frame}

\section{sec1}
\subsection{sub1}
\frame{}

\section{sec2}
\subsection{sub2}
\frame{}

\section{sec3}
\subsection{sub3}
\frame{}

\end{document}


[The vertical spacing is too big, but depending on how many sections you have, some negative vspaces can cure that]