SQL Error Unknown column 'curr' in 'SELECT'