relational-record-examples: fix alternative range condition for HRR.

This commit is contained in:
Kei Hibino 2020-02-09 23:29:19 +09:00
parent d5d4f5cedd
commit b532a92a63
2 changed files with 4 additions and 4 deletions

View File

@ -214,14 +214,14 @@ employee_4_1_2P = relation' . placeholder $ \ph -> do
-- @
-- SELECT ALL T0.emp_id AS f0, T0.fname AS f1, T0.lname AS f2,
-- T0.start_date AS f3 FROM MAIN.employee T0 WHERE ((T0.start_date >=
-- '2001-01-01') AND (T0.start_date <= '2003-01-01'))
-- '2001-01-01') AND (T0.start_date < '2003-01-01'))
-- @
--
employee_4_3_2 :: Relation () Employee2
employee_4_3_2 = relation $ do
e <- query employee
wheres $ #startDate e .>=. unsafeSQLiteDayValue "2001-01-01"
wheres $ #startDate e .<=. unsafeSQLiteDayValue "2003-01-01"
wheres $ #startDate e .<. unsafeSQLiteDayValue "2003-01-01"
return $ Employee2 |$| #empId e
|*| #fname e
|*| #lname e

View File

@ -219,14 +219,14 @@ employee_4_1_2P = relation' . placeholder $ \ph -> do
-- @
-- SELECT ALL T0.emp_id AS f0, T0.fname AS f1, T0.lname AS f2,
-- T0.start_date AS f3 FROM MAIN.employee T0 WHERE ((T0.start_date >=
-- '2001-01-01') AND (T0.start_date <= '2003-01-01'))
-- '2001-01-01') AND (T0.start_date < '2003-01-01'))
-- @
--
employee_4_3_2 :: Relation () Employee2
employee_4_3_2 = relation $ do
e <- query employee
wheres $ e ! Employee.startDate' .>=. unsafeSQLiteDayValue "2001-01-01"
wheres $ e ! Employee.startDate' .<=. unsafeSQLiteDayValue "2003-01-01"
wheres $ e ! Employee.startDate' .<. unsafeSQLiteDayValue "2003-01-01"
return $ Employee2 |$| e ! Employee.empId'
|*| e ! Employee.fname'
|*| e ! Employee.lname'