asağıdaki kodla postgresql veritabanına tekrar eden kolonlar ekleyebilirsiniz asağıdaki kodlar birden fazla sorguyu birleştirme satır sayısı ve test verileri eklemek için kullanılabilir
INSERT INTO public."ServisSchoolVisit"(
"Id", "ServisId", "SchoolId", "CasId", "VisitDateTime", "CheckGidismi")
SELECT gen_random_uuid(),'849baa74-f305-4a34-877d-872bc3a34e11','61c044cb-0c1f-4047-bbba-b7a20eabaaeb', 4, NOW()::DATE -(floor(random() * 2000)::int), true FROM generate_series(1,200000);
INSERT INTO public."ServisChildVisit"(
"Id", "ServisId", "ChildrenId", "CasId", "VisitDateTime", "CheckGidismi")
SELECT gen_random_uuid(),'849baa74-f305-4a34-877d-872bc3a34e11','1f6cea1d-e116-4107-8ae4-19fb9a9e68a1', 2, NOW()::DATE -(floor(random() * 2000)::int), true FROM generate_series(1,200000);
INSERT INTO public."ChildCheckIn"(
"Id", "ServisId", "ChildrenId", "CasId", "CheckDateTime", "CheckGidismi")
SELECT gen_random_uuid(),'849baa74-f305-4a34-877d-872bc3a34e11','1f6cea1d-e116-4107-8ae4-19fb9a9e68a1', 5, NOW()::DATE -(floor(random() * 20000)::int), true FROM generate_series(1,200000);
SELECT "Id", "ServisId", "SchoolId", "CasId", "VisitDateTime", "CheckGidismi"
FROM public."ServisSchoolVisit" where "VisitDateTime"='2020-02-11 00:00:00' and "CheckGidismi"=true and "CasId"=3
UNION
SELECT "Id", "ServisId", "ChildrenId", "CasId", "VisitDateTime", "CheckGidismi"
FROM public."ServisChildVisit" where "VisitDateTime"='2020-02-11 00:00:00' and "CheckGidismi"=true and "CasId"=2
UNION
SELECT "Id", "ServisId", "ChildrenId", "CasId", "CheckDateTime", "CheckGidismi"
FROM public."ChildCheckIn" where "CheckDateTime"='2020-02-11 00:00:00' and "CheckGidismi"=true and "CasId"=5
SELECT COUNT(*)
FROM public."ServisSchoolVisit"