• The first thing that pop'd into my head was that the temp tables are probably declared differently. Sure enough http://www.sqlite.org/tempfiles.html shows that temp tables are declared with the syntax "CREATE TEMP TABLE".

    I feel like the OP could have googled this too, but there you go. Try changing the syntax around for Dwain's code and it may work. Other syntax between the two looks fairly normal.... although I am not familiar with SQLite at all.