You should use the \addplot table command from pgfplots. The x index=0 and y index=2 specify which column is to be selected (numbering starts from 0). I have two \addplot commands to plot each column separately.
\documentclass{article}
\usepackage{pgfplots}
\usepackage{filecontents}
\begin{filecontents}{datax.dat}
1,3,6
2,4,5
3,3,7
4,1,2
5,1,1
\end{filecontents}
\begin{document}
\begin{tikzpicture}
\begin{axis}[xlabel={$x$},ylabel={Column Data}]
% Graph column 2 versus column 0
\addplot table[x index=0,y index=2,col sep=comma] {datax.dat};
\addlegendentry{Column 3}% y index+1 since humans count from 1
% Graph column 1 versus column 0
\addplot table[x index=0,y index=1,col sep=comma] {datax.dat};
\addlegendentry{Column 2}
\end{axis}
\end{tikzpicture}
\end{document}
