Closed akaraca closed 3 years ago
Hi there,
I have a basic DISTINCT query to get the distinct column results. But reading the query results give this error:
SQLite/Query.swift:1113: Fatal error: 'try!' expression unexpectedly raised an error: No such column"Town"in columns ["DISTINCT \"Town\""]
SQLite/Query.swift:1113: Fatal error: 'try!' expression unexpectedly raised an error: No such column
in columns ["DISTINCT \"Town\""]
Here is my code:
let townV = Expression<String>("Town") for item in try! db.prepare(table.select(townV.distinct)) { townList.append(item[townV]) }
Also having another column expression like below didn't work.
let townD = Expression<String>("DISTINCT Town")
Can you point me to right direction? Is there way to read columns by their index number like item[0]?
Thanks a lot.
@akaraca Can you show me where your created your table? There may be a typo or case mistake in column name for example...
Please ask on StackOverflow for this kind of questions (we are tracking bugs on GitHub)
Hi there,
I have a basic DISTINCT query to get the distinct column results. But reading the query results give this error:
SQLite/Query.swift:1113: Fatal error: 'try!' expression unexpectedly raised an error: No such column
"Town"in columns ["DISTINCT \"Town\""]
Here is my code:
Also having another column expression like below didn't work.
let townD = Expression<String>("DISTINCT Town")
Can you point me to right direction? Is there way to read columns by their index number like item[0]?
Thanks a lot.