Fixed mistake in SQL query.