Closed juandent closed 2 weeks ago
@juandent what compilation error do you get?
Errors like this:
error C2338: static_assert failed: 'Compound select statements must return a common type'
error C2672: 'sqlite_orm::internal::row_value_extractor': no matching overloaded function **found**
sqlite_orm.h(22521,27): error C3553: decltype expects an expression not a type
orm.h(22522,22): error C2976: 'std::vector': too few template arguments
etc,etc
Klaus thanks!!
Solution: use null_int instead of nullptr
constexpr std::optional<int> null_int;
auto rows = storage.select(union_all(select(columns(asterisk<Employee>(), &EmploymentHistory::id, &EmploymentHistory::fk_employee), from<Employee>(), inner_join<EmploymentHistory>(on(c(&EmploymentHistory::fk_employee) == &Employee::id))),
select(columns(asterisk<Employee>(), null_int, null_int), from<Employee>(), where(not_in(&Employee::id, select(&EmploymentHistory::fk_employee))))));
Hi, I want to represent this SQL in sqlite_orm:
Here is my attempt but it does not compile: