mirror of
https://github.com/khibino/haskell-relational-record.git
synced 2024-12-27 14:02:35 +03:00
relational-record-examples: fix alternative range condition for HRR.
This commit is contained in:
parent
d5d4f5cedd
commit
b532a92a63
@ -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
|
||||
|
@ -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'
|
||||
|
Loading…
Reference in New Issue
Block a user