mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
adjust calculate umur ayam at recording
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
UPDATE recordings r
|
||||
SET day = (
|
||||
SELECT (r.record_datetime::date - MIN(pc.chick_in_date)::date)::int + 1
|
||||
FROM project_chickins pc
|
||||
WHERE pc.project_flock_kandang_id = r.project_flock_kandangs_id
|
||||
AND pc.deleted_at IS NULL
|
||||
)
|
||||
WHERE r.deleted_at IS NULL
|
||||
AND (
|
||||
SELECT MIN(pc.chick_in_date)
|
||||
FROM project_chickins pc
|
||||
WHERE pc.project_flock_kandang_id = r.project_flock_kandangs_id
|
||||
AND pc.deleted_at IS NULL
|
||||
) IS NOT NULL;
|
||||
@@ -0,0 +1,14 @@
|
||||
UPDATE recordings r
|
||||
SET day = (
|
||||
SELECT (r.record_datetime::date - MIN(pc.chick_in_date)::date)::int
|
||||
FROM project_chickins pc
|
||||
WHERE pc.project_flock_kandang_id = r.project_flock_kandangs_id
|
||||
AND pc.deleted_at IS NULL
|
||||
)
|
||||
WHERE r.deleted_at IS NULL
|
||||
AND (
|
||||
SELECT MIN(pc.chick_in_date)
|
||||
FROM project_chickins pc
|
||||
WHERE pc.project_flock_kandang_id = r.project_flock_kandangs_id
|
||||
AND pc.deleted_at IS NULL
|
||||
) IS NOT NULL;
|
||||
Reference in New Issue
Block a user