3819 lines
145 KiB
Text
3819 lines
145 KiB
Text
2021-01-23 12:42:45.336 IST [37761] LOG: starting PostgreSQL 13.1 on x86_64-apple-darwin20.1.0, compiled by Apple clang version 12.0.0 (clang-1200.0.32.27), 64-bit
|
|
2021-01-23 12:42:45.337 IST [37761] LOG: listening on IPv4 address "127.0.0.1", port 5432
|
|
2021-01-23 12:42:45.337 IST [37761] LOG: listening on IPv6 address "::1", port 5432
|
|
2021-01-23 12:42:45.338 IST [37761] LOG: listening on Unix socket "/tmp/.s.PGSQL.5432"
|
|
2021-01-23 12:42:45.352 IST [37762] LOG: database system was interrupted; last known up at 2021-01-21 08:13:03 IST
|
|
2021-01-23 12:42:45.507 IST [37762] LOG: database system was not properly shut down; automatic recovery in progress
|
|
2021-01-23 12:42:45.513 IST [37762] LOG: redo starts at 0/3316BC8
|
|
2021-01-23 12:42:45.513 IST [37762] LOG: invalid record length at 0/3316CB0: wanted 24, got 0
|
|
2021-01-23 12:42:45.513 IST [37762] LOG: redo done at 0/3316C78
|
|
2021-01-23 12:42:45.522 IST [37761] LOG: database system is ready to accept connections
|
|
2021-01-23 14:38:53.706 IST [40210] ERROR: bind message supplies 0 parameters, but prepared statement "pdo_stmt_00000003" requires 1
|
|
2021-01-23 14:38:53.706 IST [40210] STATEMENT: select * from "tenants" where "code" = $1 limit 1
|
|
2021-01-23 14:39:00.422 IST [40215] ERROR: bind message supplies 0 parameters, but prepared statement "pdo_stmt_00000003" requires 1
|
|
2021-01-23 14:39:00.422 IST [40215] STATEMENT: select * from "tenants" where "code" = $1 limit 1
|
|
2021-01-23 16:08:04.745 IST [45258] ERROR: relation "sections" does not exist at character 15
|
|
2021-01-23 16:08:04.745 IST [45258] STATEMENT: select * from "sections" where "id" = $1 limit 1
|
|
2021-01-23 16:08:09.391 IST [45262] ERROR: relation "sections" does not exist at character 15
|
|
2021-01-23 16:08:09.391 IST [45262] STATEMENT: select * from "sections" where "id" = $1 limit 1
|
|
2021-01-23 16:09:22.542 IST [45295] ERROR: relation "sections" does not exist at character 15
|
|
2021-01-23 16:09:22.542 IST [45295] STATEMENT: select * from "sections" where "id" = $1 limit 1
|
|
2021-01-24 01:17:39.683 IST [50859] FATAL: role "postgres" does not exist
|
|
2021-01-24 01:36:57.415 IST [67292] ERROR: missing FROM-clause entry for table "sections" at character 31
|
|
2021-01-24 01:36:57.415 IST [67292] STATEMENT: select * from "classes" where "sections"."class_id" = "classes"."id" and "academic_year_id" = $1 limit 1
|
|
2021-01-24 01:41:44.028 IST [56873] ERROR: column "academic_year_id" does not exist at character 451
|
|
2021-01-24 01:41:44.028 IST [56873] STATEMENT: select * from "users" where (name ILIKE '%af%' or exists (select * from "students" where "users"."id" = "students"."user_id" and "aadhar_number"::text LIKE $1) or exists (select * from "students" where "users"."id" = "students"."user_id" and "admission_number"::text LIKE $2) and exists (select * from "students" where "users"."id" = "students"."user_id" and exists (select * from "enrolments" where "students"."user_id" = "enrolments"."user_id" and "academic_year_id" = $3))) and "users"."deleted_at" is null limit 5
|
|
2021-01-24 01:43:44.869 IST [66608] ERROR: missing FROM-clause entry for table "student" at character 281
|
|
2021-01-24 01:43:44.869 IST [66608] STATEMENT: select * from "users" where (name ILIKE '%af%' or exists (select * from "students" where "users"."id" = "students"."user_id" and "aadhar_number"::text LIKE $1) or exists (select * from "students" where "users"."id" = "students"."user_id" and "admission_number"::text LIKE $2) and "student"."enrolment" = (select * where "has" = $3)) and "users"."deleted_at" is null limit 5
|
|
2021-01-24 14:36:15.553 IST [61561] ERROR: update or delete on table "payments" violates foreign key constraint "late_fees_payment_id_foreign" on table "late_fees"
|
|
2021-01-24 14:36:15.553 IST [61561] DETAIL: Key (id)=(14) is still referenced from table "late_fees".
|
|
2021-01-24 14:36:15.553 IST [61561] STATEMENT: DELETE FROM "tnt_cf809103-d949-4562-896e-bcef7c73e8d7"."payments" WHERE "id" = '14' OR "id" = '15' OR "id" = '16' OR "id" = '17' OR "id" = '18' OR "id" = '19' OR "id" = '20' OR "id" = '21' OR "id" = '22' OR "id" = '23' OR "id" = '24' OR "id" = '25' OR "id" = '26' OR "id" = '27' OR "id" = '28' OR "id" = '29' OR "id" = '30' OR "id" = '31' OR "id" = '32' OR "id" = '33' OR "id" = '34';
|
|
2021-01-24 14:52:27.013 IST [54028] ERROR: relation "tnt_c05488f1-1124-4d7f-81ef-3c7e9fb5b6d2.academic_years" does not exist at character 13
|
|
2021-01-24 14:52:27.013 IST [54028] STATEMENT: INSERT INTO "tnt_c05488f1-1124-4d7f-81ef-3c7e9fb5b6d2".academic_years (id, title, start_at, end_at, is_active, created_at, updated_at) VALUES ( $1, $2, $3, $4, $5, $6, $7)
|
|
2021-01-24 16:13:57.532 IST [79798] ERROR: column "academic_year_ids" does not exist at character 712
|
|
2021-01-24 16:13:57.532 IST [79798] HINT: Perhaps you meant to reference the column "classes.academic_year_id".
|
|
2021-01-24 16:13:57.532 IST [79798] STATEMENT: select * from "enrolments" where exists (select * from "users" where "enrolments"."user_id" = "users"."id" and "name"::text LIKE $1 and "users"."deleted_at" is null) or exists (select * from "users" where "enrolments"."user_id" = "users"."id" and "aadhar_number"::text LIKE $2 and "users"."deleted_at" is null) or exists (select * from "users" where "enrolments"."user_id" = "users"."id" and exists (select * from "students" where "users"."id" = "students"."user_id" and "admission_number"::text LIKE $3) and "users"."deleted_at" is null) and exists (select * from "sections" where "enrolments"."section_id" = "sections"."id" and exists (select * from "classes" where "sections"."class_id" = "classes"."id" and "academic_year_ids" = $4)) limit 5
|
|
2021-01-24 16:16:00.358 IST [61561] ERROR: syntax error at or near "%" at character 716
|
|
2021-01-24 16:16:00.358 IST [61561] STATEMENT: -- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payment_items pi
|
|
-- left join "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payments p on p.id = pi.payment_id
|
|
-- where p.enrolment_id = 1
|
|
-- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".users where "name" LIKE '%afi%'
|
|
-- DROP schema "tnt_788478b3-dcc8-4b5f-b4ee-d51c861333ff" CASCADE;
|
|
-- select * from "tnt_cf809103-d949-4562-896e-bcef7c73e8d7".users where phone = '9705664434'
|
|
-- select * from "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments where user_id = 1340
|
|
select
|
|
*
|
|
from
|
|
"enrolments"
|
|
where
|
|
exists (
|
|
select
|
|
*
|
|
from
|
|
"users"
|
|
where
|
|
"enrolments"."user_id" = "users"."id"
|
|
and "name" :: text LIKE % maya %
|
|
and "users"."deleted_at" is null
|
|
)
|
|
or exists (
|
|
select
|
|
*
|
|
from
|
|
"users"
|
|
where
|
|
"enrolments"."user_id" = "users"."id"
|
|
and "aadhar_number" :: text LIKE % maya %
|
|
and "users"."deleted_at" is null
|
|
)
|
|
or exists (
|
|
select
|
|
*
|
|
from
|
|
"users"
|
|
where
|
|
"enrolments"."user_id" = "users"."id"
|
|
and exists (
|
|
select
|
|
*
|
|
from
|
|
"students"
|
|
where
|
|
"users"."id" = "students"."user_id"
|
|
and "admission_number" :: text LIKE % maya %
|
|
)
|
|
and "users"."deleted_at" is null
|
|
)
|
|
and exists (
|
|
select
|
|
*
|
|
from
|
|
"sections"
|
|
where
|
|
"enrolments"."section_id" = "sections"."id"
|
|
and exists (
|
|
select
|
|
*
|
|
from
|
|
"classes"
|
|
where
|
|
"sections"."class_id" = "classes"."id"
|
|
and "academic_year_id" = 21
|
|
)
|
|
)
|
|
limit
|
|
5
|
|
)
|
|
2021-01-24 16:16:34.283 IST [61561] ERROR: syntax error at or near ")" at character 1647
|
|
2021-01-24 16:16:34.283 IST [61561] STATEMENT: -- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payment_items pi
|
|
-- left join "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payments p on p.id = pi.payment_id
|
|
-- where p.enrolment_id = 1
|
|
-- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".users where "name" LIKE '%afi%'
|
|
-- DROP schema "tnt_788478b3-dcc8-4b5f-b4ee-d51c861333ff" CASCADE;
|
|
-- select * from "tnt_cf809103-d949-4562-896e-bcef7c73e8d7".users where phone = '9705664434'
|
|
-- select * from "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments where user_id = 1340
|
|
select
|
|
*
|
|
from
|
|
"enrolments"
|
|
where
|
|
exists (
|
|
select
|
|
*
|
|
from
|
|
"users"
|
|
where
|
|
"enrolments"."user_id" = "users"."id"
|
|
and "name" :: text LIKE '%maya%'
|
|
and "users"."deleted_at" is null
|
|
)
|
|
or exists (
|
|
select
|
|
*
|
|
from
|
|
"users"
|
|
where
|
|
"enrolments"."user_id" = "users"."id"
|
|
and "aadhar_number" :: text LIKE '%maya%'
|
|
and "users"."deleted_at" is null
|
|
)
|
|
or exists (
|
|
select
|
|
*
|
|
from
|
|
"users"
|
|
where
|
|
"enrolments"."user_id" = "users"."id"
|
|
and exists (
|
|
select
|
|
*
|
|
from
|
|
"students"
|
|
where
|
|
"users"."id" = "students"."user_id"
|
|
and "admission_number" :: text LIKE '%maya%'
|
|
)
|
|
and "users"."deleted_at" is null
|
|
)
|
|
and exists (
|
|
select
|
|
*
|
|
from
|
|
"sections"
|
|
where
|
|
"enrolments"."section_id" = "sections"."id"
|
|
and exists (
|
|
select
|
|
*
|
|
from
|
|
"classes"
|
|
where
|
|
"sections"."class_id" = "classes"."id"
|
|
and "academic_year_id" = 21
|
|
)
|
|
)
|
|
limit
|
|
5
|
|
)
|
|
2021-01-24 16:16:45.440 IST [61561] ERROR: relation "enrolments" does not exist at character 560
|
|
2021-01-24 16:16:45.440 IST [61561] STATEMENT: -- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payment_items pi
|
|
-- left join "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payments p on p.id = pi.payment_id
|
|
-- where p.enrolment_id = 1
|
|
-- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".users where "name" LIKE '%afi%'
|
|
-- DROP schema "tnt_788478b3-dcc8-4b5f-b4ee-d51c861333ff" CASCADE;
|
|
-- select * from "tnt_cf809103-d949-4562-896e-bcef7c73e8d7".users where phone = '9705664434'
|
|
-- select * from "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments where user_id = 1340
|
|
select
|
|
*
|
|
from
|
|
"enrolments"
|
|
where
|
|
exists (
|
|
select
|
|
*
|
|
from
|
|
"users"
|
|
where
|
|
"enrolments"."user_id" = "users"."id"
|
|
and "name" :: text LIKE '%maya%'
|
|
and "users"."deleted_at" is null
|
|
)
|
|
or exists (
|
|
select
|
|
*
|
|
from
|
|
"users"
|
|
where
|
|
"enrolments"."user_id" = "users"."id"
|
|
and "aadhar_number" :: text LIKE '%maya%'
|
|
and "users"."deleted_at" is null
|
|
)
|
|
or exists (
|
|
select
|
|
*
|
|
from
|
|
"users"
|
|
where
|
|
"enrolments"."user_id" = "users"."id"
|
|
and exists (
|
|
select
|
|
*
|
|
from
|
|
"students"
|
|
where
|
|
"users"."id" = "students"."user_id"
|
|
and "admission_number" :: text LIKE '%maya%'
|
|
)
|
|
and "users"."deleted_at" is null
|
|
)
|
|
and exists (
|
|
select
|
|
*
|
|
from
|
|
"sections"
|
|
where
|
|
"enrolments"."section_id" = "sections"."id"
|
|
and exists (
|
|
select
|
|
*
|
|
from
|
|
"classes"
|
|
where
|
|
"sections"."class_id" = "classes"."id"
|
|
and "academic_year_id" = 21
|
|
)
|
|
)
|
|
limit
|
|
5
|
|
2021-01-24 16:17:32.152 IST [61561] ERROR: relation "students" does not exist at character 1320
|
|
2021-01-24 16:17:32.152 IST [61561] STATEMENT: -- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payment_items pi
|
|
-- left join "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payments p on p.id = pi.payment_id
|
|
-- where p.enrolment_id = 1
|
|
-- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".users where "name" LIKE '%afi%'
|
|
-- DROP schema "tnt_788478b3-dcc8-4b5f-b4ee-d51c861333ff" CASCADE;
|
|
-- select * from "tnt_cf809103-d949-4562-896e-bcef7c73e8d7".users where phone = '9705664434'
|
|
-- select * from "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments where user_id = 1340
|
|
select
|
|
*
|
|
from
|
|
"tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."enrolments"
|
|
where
|
|
exists (
|
|
select
|
|
*
|
|
from
|
|
"tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
where
|
|
"enrolments"."user_id" = "users"."id"
|
|
and "name" :: text LIKE '%maya%'
|
|
and "users"."deleted_at" is null
|
|
)
|
|
or exists (
|
|
select
|
|
*
|
|
from
|
|
"tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
where
|
|
"enrolments"."user_id" = "users"."id"
|
|
and "aadhar_number" :: text LIKE '%maya%'
|
|
and "users"."deleted_at" is null
|
|
)
|
|
or exists (
|
|
select
|
|
*
|
|
from
|
|
"tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
where
|
|
"enrolments"."user_id" = "users"."id"
|
|
and exists (
|
|
select
|
|
*
|
|
from
|
|
"students"
|
|
where
|
|
"users"."id" = "students"."user_id"
|
|
and "admission_number" :: text LIKE '%maya%'
|
|
)
|
|
and "users"."deleted_at" is null
|
|
)
|
|
and exists (
|
|
select
|
|
*
|
|
from
|
|
"tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."sections"
|
|
where
|
|
"enrolments"."section_id" = "sections"."id"
|
|
and exists (
|
|
select
|
|
*
|
|
from
|
|
"tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."classes"
|
|
where
|
|
"sections"."class_id" = "classes"."id"
|
|
and "academic_year_id" = 21
|
|
)
|
|
)
|
|
limit
|
|
5
|
|
2021-01-24 16:21:47.191 IST [61561] ERROR: table name "s" specified more than once
|
|
2021-01-24 16:21:47.191 IST [61561] STATEMENT: -- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payment_items pi
|
|
-- left join "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payments p on p.id = pi.payment_id
|
|
-- where p.enrolment_id = 1
|
|
-- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".users where "name" LIKE '%afi%'
|
|
-- DROP schema "tnt_788478b3-dcc8-4b5f-b4ee-d51c861333ff" CASCADE;
|
|
-- select * from "tnt_cf809103-d949-4562-896e-bcef7c73e8d7".users where phone = '9705664434'
|
|
-- select * from "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments where user_id = 1340
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."enrolments"
|
|
-- where
|
|
-- exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "name" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "aadhar_number" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."students"
|
|
-- where
|
|
-- "users"."id" = "students"."user_id"
|
|
-- and "admission_number" :: text LIKE '%maya%'
|
|
-- )
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."sections"
|
|
-- where
|
|
-- "enrolments"."section_id" = "sections"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."classes"
|
|
-- where
|
|
-- "sections"."class_id" = "classes"."id"
|
|
-- and "academic_year_id" = 21
|
|
-- )
|
|
-- )
|
|
-- limit
|
|
-- 5
|
|
|
|
select
|
|
*
|
|
from
|
|
"tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".users u on u.id = e.user_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".students s on s.user_id = u.id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
where
|
|
c.academic_year_id = 21
|
|
and u.name like '%maya%'
|
|
or s.admission_number like '%maya%'
|
|
or u.aadhar_number like '%maya%'
|
|
2021-01-24 17:11:18.471 IST [41136] ERROR: missing FROM-clause entry for table "section_id, enrolments" at character 8
|
|
2021-01-24 17:11:18.471 IST [41136] STATEMENT: select "enrolments"."section_id, enrolments"."id" from "enrolments" inner join "users" on "users"."id" = "enrolments"."user_id" inner join "students" on "students"."user_id" = "users"."id" inner join "sections" on "sections"."id" = "enrolments"."section_id" inner join "classes" on "classes"."id" = "sections"."class_id" where "classes"."academic_year_id" = $1 and "users"."name"::text LIKE $2 or "users"."aadhar_number"::text LIKE $3 or "students"."admission_number"::text LIKE $4 limit 5
|
|
2021-01-24 17:32:01.504 IST [53198] ERROR: column students.admission does not exist at character 166
|
|
2021-01-24 17:32:01.504 IST [53198] STATEMENT: select "enrolments"."id", "enrolments"."section_id", "users"."name", "sections"."name" as "section_name", "classes"."name" as "class_name", "users"."aadhar_number", "students"."admission" from "enrolments" inner join "users" on "users"."id" = "enrolments"."user_id" inner join "students" on "students"."user_id" = "users"."id" inner join "sections" on "sections"."id" = "enrolments"."section_id" inner join "classes" on "classes"."id" = "sections"."class_id" where "classes"."academic_year_id" = $1 and "users"."name"::text LIKE $2 or "users"."aadhar_number"::text LIKE $3 or "students"."admission_number"::text LIKE $4 limit 5
|
|
2021-01-24 17:42:19.170 IST [15965] ERROR: invalid input syntax for type bigint: "undefined"
|
|
2021-01-24 17:42:19.170 IST [15965] STATEMENT: select * from "enrolments" where "enrolments"."id" = $1 limit 1
|
|
2021-01-24 17:42:19.170 IST [15967] ERROR: invalid input syntax for type bigint: "undefined"
|
|
2021-01-24 17:42:19.170 IST [15967] STATEMENT: select * from "enrolments" where "enrolments"."id" = $1 limit 1
|
|
2021-01-24 17:42:33.397 IST [34326] ERROR: invalid input syntax for type bigint: "undefined"
|
|
2021-01-24 17:42:33.397 IST [34326] STATEMENT: select * from "enrolments" where "enrolments"."id" = $1 limit 1
|
|
2021-01-24 17:42:33.397 IST [34328] ERROR: invalid input syntax for type bigint: "undefined"
|
|
2021-01-24 17:42:33.397 IST [34328] STATEMENT: select * from "enrolments" where "enrolments"."id" = $1 limit 1
|
|
2021-01-24 17:42:49.746 IST [55543] ERROR: invalid input syntax for type bigint: "undefined"
|
|
2021-01-24 17:42:49.746 IST [55543] STATEMENT: select * from "enrolments" where "enrolments"."id" = $1 limit 1
|
|
2021-01-24 17:42:49.746 IST [55544] ERROR: invalid input syntax for type bigint: "undefined"
|
|
2021-01-24 17:42:49.746 IST [55544] STATEMENT: select * from "enrolments" where "enrolments"."id" = $1 limit 1
|
|
2021-01-24 18:05:18.709 IST [36131] ERROR: column sections.standard_id does not exist at character 87
|
|
2021-01-24 18:05:18.709 IST [36131] STATEMENT: select count(*) as aggregate from "sections" inner join "classes" on "classes"."id" = "sections"."standard_id" where "classes"."academic_year_id" = $1
|
|
2021-01-24 18:06:14.567 IST [276] ERROR: column sections.standard_id does not exist at character 87
|
|
2021-01-24 18:06:14.567 IST [276] STATEMENT: select count(*) as aggregate from "sections" inner join "classes" on "classes"."id" = "sections"."standard_id" where "classes"."class_id" = $1
|
|
2021-01-24 19:17:35.056 IST [61561] ERROR: syntax error at or near ""tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"" at character 10
|
|
2021-01-24 19:17:35.056 IST [61561] STATEMENT: select * "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payments p
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e on e.id = p.enrolment_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
where c.academic_year_id = 21
|
|
2021-01-24 19:18:40.073 IST [61561] ERROR: syntax error at or near "select" at character 3383
|
|
2021-01-24 19:18:40.073 IST [61561] STATEMENT: -- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payment_items pi
|
|
-- left join "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payments p on p.id = pi.payment_id
|
|
-- where p.enrolment_id = 1
|
|
-- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".users where "name" LIKE '%afi%'
|
|
-- DROP schema "tnt_788478b3-dcc8-4b5f-b4ee-d51c861333ff" CASCADE;
|
|
-- select * from "tnt_cf809103-d949-4562-896e-bcef7c73e8d7".users where phone = '9705664434'
|
|
-- select * from "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments where user_id = 1340
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."enrolments"
|
|
-- where
|
|
-- exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "name" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "aadhar_number" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."students"
|
|
-- where
|
|
-- "users"."id" = "students"."user_id"
|
|
-- and "admission_number" :: text LIKE '%maya%'
|
|
-- )
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."sections"
|
|
-- where
|
|
-- "enrolments"."section_id" = "sections"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."classes"
|
|
-- where
|
|
-- "sections"."class_id" = "classes"."id"
|
|
-- and "academic_year_id" = 21
|
|
-- )
|
|
-- )
|
|
-- limit
|
|
-- 5
|
|
-------------------------------------------
|
|
-- AUTO COMPLETE
|
|
-------------------------------------------
|
|
-- select
|
|
-- u.id, s."name" as section_name, u."name" as name, c."name" as class_name, u.aadhar_number, st.admission_number, s.id as section_id, c.id as class_id
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".users u on u.id = e.user_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".students st on st.user_id = u.id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21
|
|
-- and u.name like '%maya%'
|
|
-- or st.admission_number like '%maya%'
|
|
-- or u.aadhar_number like '%maya%'
|
|
-------------------------------------------
|
|
-- SECTIONS
|
|
-------------------------------------------
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21;
|
|
-------------------------------------------
|
|
-- OTHER
|
|
-------------------------------------------
|
|
select amount_paid (
|
|
select
|
|
sum(amount_paid)
|
|
from
|
|
"tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payments p
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e on e.id = p.enrolment_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
where
|
|
c.academic_year_id = 21
|
|
)
|
|
2021-01-24 19:18:47.493 IST [61561] ERROR: syntax error at or near "select" at character 3383
|
|
2021-01-24 19:18:47.493 IST [61561] STATEMENT: -- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payment_items pi
|
|
-- left join "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payments p on p.id = pi.payment_id
|
|
-- where p.enrolment_id = 1
|
|
-- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".users where "name" LIKE '%afi%'
|
|
-- DROP schema "tnt_788478b3-dcc8-4b5f-b4ee-d51c861333ff" CASCADE;
|
|
-- select * from "tnt_cf809103-d949-4562-896e-bcef7c73e8d7".users where phone = '9705664434'
|
|
-- select * from "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments where user_id = 1340
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."enrolments"
|
|
-- where
|
|
-- exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "name" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "aadhar_number" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."students"
|
|
-- where
|
|
-- "users"."id" = "students"."user_id"
|
|
-- and "admission_number" :: text LIKE '%maya%'
|
|
-- )
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."sections"
|
|
-- where
|
|
-- "enrolments"."section_id" = "sections"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."classes"
|
|
-- where
|
|
-- "sections"."class_id" = "classes"."id"
|
|
-- and "academic_year_id" = 21
|
|
-- )
|
|
-- )
|
|
-- limit
|
|
-- 5
|
|
-------------------------------------------
|
|
-- AUTO COMPLETE
|
|
-------------------------------------------
|
|
-- select
|
|
-- u.id, s."name" as section_name, u."name" as name, c."name" as class_name, u.aadhar_number, st.admission_number, s.id as section_id, c.id as class_id
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".users u on u.id = e.user_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".students st on st.user_id = u.id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21
|
|
-- and u.name like '%maya%'
|
|
-- or st.admission_number like '%maya%'
|
|
-- or u.aadhar_number like '%maya%'
|
|
-------------------------------------------
|
|
-- SECTIONS
|
|
-------------------------------------------
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21;
|
|
-------------------------------------------
|
|
-- OTHER
|
|
-------------------------------------------
|
|
select amount_paid (
|
|
select
|
|
sum(amount_paid) as amount_paid
|
|
from
|
|
"tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payments p
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e on e.id = p.enrolment_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
where
|
|
c.academic_year_id = 21
|
|
)
|
|
2021-01-24 19:18:57.121 IST [61561] ERROR: syntax error at or near "select" at character 3383
|
|
2021-01-24 19:18:57.121 IST [61561] STATEMENT: -- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payment_items pi
|
|
-- left join "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payments p on p.id = pi.payment_id
|
|
-- where p.enrolment_id = 1
|
|
-- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".users where "name" LIKE '%afi%'
|
|
-- DROP schema "tnt_788478b3-dcc8-4b5f-b4ee-d51c861333ff" CASCADE;
|
|
-- select * from "tnt_cf809103-d949-4562-896e-bcef7c73e8d7".users where phone = '9705664434'
|
|
-- select * from "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments where user_id = 1340
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."enrolments"
|
|
-- where
|
|
-- exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "name" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "aadhar_number" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."students"
|
|
-- where
|
|
-- "users"."id" = "students"."user_id"
|
|
-- and "admission_number" :: text LIKE '%maya%'
|
|
-- )
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."sections"
|
|
-- where
|
|
-- "enrolments"."section_id" = "sections"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."classes"
|
|
-- where
|
|
-- "sections"."class_id" = "classes"."id"
|
|
-- and "academic_year_id" = 21
|
|
-- )
|
|
-- )
|
|
-- limit
|
|
-- 5
|
|
-------------------------------------------
|
|
-- AUTO COMPLETE
|
|
-------------------------------------------
|
|
-- select
|
|
-- u.id, s."name" as section_name, u."name" as name, c."name" as class_name, u.aadhar_number, st.admission_number, s.id as section_id, c.id as class_id
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".users u on u.id = e.user_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".students st on st.user_id = u.id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21
|
|
-- and u.name like '%maya%'
|
|
-- or st.admission_number like '%maya%'
|
|
-- or u.aadhar_number like '%maya%'
|
|
-------------------------------------------
|
|
-- SECTIONS
|
|
-------------------------------------------
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21;
|
|
-------------------------------------------
|
|
-- OTHER
|
|
-------------------------------------------
|
|
select amount_paid (
|
|
select
|
|
sum(amount_paid) as amount_paid
|
|
from
|
|
"tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payments p
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e on e.id = p.enrolment_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
where
|
|
c.academic_year_id = 21
|
|
) t
|
|
2021-01-24 19:19:01.024 IST [61561] ERROR: syntax error at or near "select" at character 3385
|
|
2021-01-24 19:19:01.024 IST [61561] STATEMENT: -- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payment_items pi
|
|
-- left join "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payments p on p.id = pi.payment_id
|
|
-- where p.enrolment_id = 1
|
|
-- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".users where "name" LIKE '%afi%'
|
|
-- DROP schema "tnt_788478b3-dcc8-4b5f-b4ee-d51c861333ff" CASCADE;
|
|
-- select * from "tnt_cf809103-d949-4562-896e-bcef7c73e8d7".users where phone = '9705664434'
|
|
-- select * from "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments where user_id = 1340
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."enrolments"
|
|
-- where
|
|
-- exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "name" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "aadhar_number" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."students"
|
|
-- where
|
|
-- "users"."id" = "students"."user_id"
|
|
-- and "admission_number" :: text LIKE '%maya%'
|
|
-- )
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."sections"
|
|
-- where
|
|
-- "enrolments"."section_id" = "sections"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."classes"
|
|
-- where
|
|
-- "sections"."class_id" = "classes"."id"
|
|
-- and "academic_year_id" = 21
|
|
-- )
|
|
-- )
|
|
-- limit
|
|
-- 5
|
|
-------------------------------------------
|
|
-- AUTO COMPLETE
|
|
-------------------------------------------
|
|
-- select
|
|
-- u.id, s."name" as section_name, u."name" as name, c."name" as class_name, u.aadhar_number, st.admission_number, s.id as section_id, c.id as class_id
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".users u on u.id = e.user_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".students st on st.user_id = u.id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21
|
|
-- and u.name like '%maya%'
|
|
-- or st.admission_number like '%maya%'
|
|
-- or u.aadhar_number like '%maya%'
|
|
-------------------------------------------
|
|
-- SECTIONS
|
|
-------------------------------------------
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21;
|
|
-------------------------------------------
|
|
-- OTHER
|
|
-------------------------------------------
|
|
select t.amount_paid (
|
|
select
|
|
sum(amount_paid) as amount_paid
|
|
from
|
|
"tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payments p
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e on e.id = p.enrolment_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
where
|
|
c.academic_year_id = 21
|
|
) t
|
|
2021-01-24 19:19:33.948 IST [61561] ERROR: syntax error at or near "(" at character 3371
|
|
2021-01-24 19:19:33.948 IST [61561] STATEMENT: -- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payment_items pi
|
|
-- left join "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payments p on p.id = pi.payment_id
|
|
-- where p.enrolment_id = 1
|
|
-- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".users where "name" LIKE '%afi%'
|
|
-- DROP schema "tnt_788478b3-dcc8-4b5f-b4ee-d51c861333ff" CASCADE;
|
|
-- select * from "tnt_cf809103-d949-4562-896e-bcef7c73e8d7".users where phone = '9705664434'
|
|
-- select * from "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments where user_id = 1340
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."enrolments"
|
|
-- where
|
|
-- exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "name" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "aadhar_number" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."students"
|
|
-- where
|
|
-- "users"."id" = "students"."user_id"
|
|
-- and "admission_number" :: text LIKE '%maya%'
|
|
-- )
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."sections"
|
|
-- where
|
|
-- "enrolments"."section_id" = "sections"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."classes"
|
|
-- where
|
|
-- "sections"."class_id" = "classes"."id"
|
|
-- and "academic_year_id" = 21
|
|
-- )
|
|
-- )
|
|
-- limit
|
|
-- 5
|
|
-------------------------------------------
|
|
-- AUTO COMPLETE
|
|
-------------------------------------------
|
|
-- select
|
|
-- u.id, s."name" as section_name, u."name" as name, c."name" as class_name, u.aadhar_number, st.admission_number, s.id as section_id, c.id as class_id
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".users u on u.id = e.user_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".students st on st.user_id = u.id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21
|
|
-- and u.name like '%maya%'
|
|
-- or st.admission_number like '%maya%'
|
|
-- or u.aadhar_number like '%maya%'
|
|
-------------------------------------------
|
|
-- SECTIONS
|
|
-------------------------------------------
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21;
|
|
-------------------------------------------
|
|
-- OTHER
|
|
-------------------------------------------
|
|
select * (
|
|
select
|
|
sum(amount_paid) as amount_paid
|
|
from
|
|
"tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payments p
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e on e.id = p.enrolment_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
where
|
|
c.academic_year_id = 21
|
|
) t
|
|
2021-01-24 19:19:44.475 IST [61561] ERROR: column "amount_paid" does not exist at character 3376
|
|
2021-01-24 19:19:44.475 IST [61561] STATEMENT: -- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payment_items pi
|
|
-- left join "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payments p on p.id = pi.payment_id
|
|
-- where p.enrolment_id = 1
|
|
-- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".users where "name" LIKE '%afi%'
|
|
-- DROP schema "tnt_788478b3-dcc8-4b5f-b4ee-d51c861333ff" CASCADE;
|
|
-- select * from "tnt_cf809103-d949-4562-896e-bcef7c73e8d7".users where phone = '9705664434'
|
|
-- select * from "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments where user_id = 1340
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."enrolments"
|
|
-- where
|
|
-- exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "name" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "aadhar_number" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."students"
|
|
-- where
|
|
-- "users"."id" = "students"."user_id"
|
|
-- and "admission_number" :: text LIKE '%maya%'
|
|
-- )
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."sections"
|
|
-- where
|
|
-- "enrolments"."section_id" = "sections"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."classes"
|
|
-- where
|
|
-- "sections"."class_id" = "classes"."id"
|
|
-- and "academic_year_id" = 21
|
|
-- )
|
|
-- )
|
|
-- limit
|
|
-- 5
|
|
-------------------------------------------
|
|
-- AUTO COMPLETE
|
|
-------------------------------------------
|
|
-- select
|
|
-- u.id, s."name" as section_name, u."name" as name, c."name" as class_name, u.aadhar_number, st.admission_number, s.id as section_id, c.id as class_id
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".users u on u.id = e.user_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".students st on st.user_id = u.id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21
|
|
-- and u.name like '%maya%'
|
|
-- or st.admission_number like '%maya%'
|
|
-- or u.aadhar_number like '%maya%'
|
|
-------------------------------------------
|
|
-- SECTIONS
|
|
-------------------------------------------
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21;
|
|
-------------------------------------------
|
|
-- OTHER
|
|
-------------------------------------------
|
|
|
|
select
|
|
sum(amount_paid) as amount_paid
|
|
from
|
|
"tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payments p
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e on e.id = p.enrolment_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
where
|
|
c.academic_year_id = 21
|
|
|
|
2021-01-24 19:19:49.689 IST [61561] ERROR: column p.amount_paid does not exist at character 3376
|
|
2021-01-24 19:19:49.689 IST [61561] STATEMENT: -- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payment_items pi
|
|
-- left join "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payments p on p.id = pi.payment_id
|
|
-- where p.enrolment_id = 1
|
|
-- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".users where "name" LIKE '%afi%'
|
|
-- DROP schema "tnt_788478b3-dcc8-4b5f-b4ee-d51c861333ff" CASCADE;
|
|
-- select * from "tnt_cf809103-d949-4562-896e-bcef7c73e8d7".users where phone = '9705664434'
|
|
-- select * from "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments where user_id = 1340
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."enrolments"
|
|
-- where
|
|
-- exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "name" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "aadhar_number" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."students"
|
|
-- where
|
|
-- "users"."id" = "students"."user_id"
|
|
-- and "admission_number" :: text LIKE '%maya%'
|
|
-- )
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."sections"
|
|
-- where
|
|
-- "enrolments"."section_id" = "sections"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."classes"
|
|
-- where
|
|
-- "sections"."class_id" = "classes"."id"
|
|
-- and "academic_year_id" = 21
|
|
-- )
|
|
-- )
|
|
-- limit
|
|
-- 5
|
|
-------------------------------------------
|
|
-- AUTO COMPLETE
|
|
-------------------------------------------
|
|
-- select
|
|
-- u.id, s."name" as section_name, u."name" as name, c."name" as class_name, u.aadhar_number, st.admission_number, s.id as section_id, c.id as class_id
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".users u on u.id = e.user_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".students st on st.user_id = u.id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21
|
|
-- and u.name like '%maya%'
|
|
-- or st.admission_number like '%maya%'
|
|
-- or u.aadhar_number like '%maya%'
|
|
-------------------------------------------
|
|
-- SECTIONS
|
|
-------------------------------------------
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21;
|
|
-------------------------------------------
|
|
-- OTHER
|
|
-------------------------------------------
|
|
|
|
select
|
|
sum(p.amount_paid) as amount_paid
|
|
from
|
|
"tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payments p
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e on e.id = p.enrolment_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
where
|
|
c.academic_year_id = 21
|
|
|
|
2021-01-24 19:19:55.495 IST [61561] ERROR: column p.amount does not exist at character 3376
|
|
2021-01-24 19:19:55.495 IST [61561] STATEMENT: -- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payment_items pi
|
|
-- left join "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payments p on p.id = pi.payment_id
|
|
-- where p.enrolment_id = 1
|
|
-- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".users where "name" LIKE '%afi%'
|
|
-- DROP schema "tnt_788478b3-dcc8-4b5f-b4ee-d51c861333ff" CASCADE;
|
|
-- select * from "tnt_cf809103-d949-4562-896e-bcef7c73e8d7".users where phone = '9705664434'
|
|
-- select * from "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments where user_id = 1340
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."enrolments"
|
|
-- where
|
|
-- exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "name" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "aadhar_number" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."students"
|
|
-- where
|
|
-- "users"."id" = "students"."user_id"
|
|
-- and "admission_number" :: text LIKE '%maya%'
|
|
-- )
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."sections"
|
|
-- where
|
|
-- "enrolments"."section_id" = "sections"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."classes"
|
|
-- where
|
|
-- "sections"."class_id" = "classes"."id"
|
|
-- and "academic_year_id" = 21
|
|
-- )
|
|
-- )
|
|
-- limit
|
|
-- 5
|
|
-------------------------------------------
|
|
-- AUTO COMPLETE
|
|
-------------------------------------------
|
|
-- select
|
|
-- u.id, s."name" as section_name, u."name" as name, c."name" as class_name, u.aadhar_number, st.admission_number, s.id as section_id, c.id as class_id
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".users u on u.id = e.user_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".students st on st.user_id = u.id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21
|
|
-- and u.name like '%maya%'
|
|
-- or st.admission_number like '%maya%'
|
|
-- or u.aadhar_number like '%maya%'
|
|
-------------------------------------------
|
|
-- SECTIONS
|
|
-------------------------------------------
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21;
|
|
-------------------------------------------
|
|
-- OTHER
|
|
-------------------------------------------
|
|
|
|
select
|
|
sum(p.amount) as amount_paid
|
|
from
|
|
"tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payments p
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e on e.id = p.enrolment_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
where
|
|
c.academic_year_id = 21
|
|
|
|
2021-01-24 19:20:43.122 IST [61561] ERROR: column p.amount does not exist at character 3376
|
|
2021-01-24 19:20:43.122 IST [61561] HINT: Perhaps you meant to reference the column "pi.amount".
|
|
2021-01-24 19:20:43.122 IST [61561] STATEMENT: -- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payment_items pi
|
|
-- left join "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payments p on p.id = pi.payment_id
|
|
-- where p.enrolment_id = 1
|
|
-- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".users where "name" LIKE '%afi%'
|
|
-- DROP schema "tnt_788478b3-dcc8-4b5f-b4ee-d51c861333ff" CASCADE;
|
|
-- select * from "tnt_cf809103-d949-4562-896e-bcef7c73e8d7".users where phone = '9705664434'
|
|
-- select * from "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments where user_id = 1340
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."enrolments"
|
|
-- where
|
|
-- exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "name" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "aadhar_number" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."students"
|
|
-- where
|
|
-- "users"."id" = "students"."user_id"
|
|
-- and "admission_number" :: text LIKE '%maya%'
|
|
-- )
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."sections"
|
|
-- where
|
|
-- "enrolments"."section_id" = "sections"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."classes"
|
|
-- where
|
|
-- "sections"."class_id" = "classes"."id"
|
|
-- and "academic_year_id" = 21
|
|
-- )
|
|
-- )
|
|
-- limit
|
|
-- 5
|
|
-------------------------------------------
|
|
-- AUTO COMPLETE
|
|
-------------------------------------------
|
|
-- select
|
|
-- u.id, s."name" as section_name, u."name" as name, c."name" as class_name, u.aadhar_number, st.admission_number, s.id as section_id, c.id as class_id
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".users u on u.id = e.user_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".students st on st.user_id = u.id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21
|
|
-- and u.name like '%maya%'
|
|
-- or st.admission_number like '%maya%'
|
|
-- or u.aadhar_number like '%maya%'
|
|
-------------------------------------------
|
|
-- SECTIONS
|
|
-------------------------------------------
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21;
|
|
-------------------------------------------
|
|
-- OTHER
|
|
-------------------------------------------
|
|
|
|
select
|
|
sum(p.amount) as amount_paid
|
|
from
|
|
"tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payments p
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e on e.id = p.enrolment_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payment_items pi on pi.payment_id = p.id
|
|
where
|
|
c.academic_year_id = 21
|
|
|
|
2021-01-24 19:21:15.388 IST [61561] ERROR: syntax error at or near "(" at character 3372
|
|
2021-01-24 19:21:15.388 IST [61561] STATEMENT: -- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payment_items pi
|
|
-- left join "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payments p on p.id = pi.payment_id
|
|
-- where p.enrolment_id = 1
|
|
-- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".users where "name" LIKE '%afi%'
|
|
-- DROP schema "tnt_788478b3-dcc8-4b5f-b4ee-d51c861333ff" CASCADE;
|
|
-- select * from "tnt_cf809103-d949-4562-896e-bcef7c73e8d7".users where phone = '9705664434'
|
|
-- select * from "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments where user_id = 1340
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."enrolments"
|
|
-- where
|
|
-- exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "name" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "aadhar_number" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."students"
|
|
-- where
|
|
-- "users"."id" = "students"."user_id"
|
|
-- and "admission_number" :: text LIKE '%maya%'
|
|
-- )
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."sections"
|
|
-- where
|
|
-- "enrolments"."section_id" = "sections"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."classes"
|
|
-- where
|
|
-- "sections"."class_id" = "classes"."id"
|
|
-- and "academic_year_id" = 21
|
|
-- )
|
|
-- )
|
|
-- limit
|
|
-- 5
|
|
-------------------------------------------
|
|
-- AUTO COMPLETE
|
|
-------------------------------------------
|
|
-- select
|
|
-- u.id, s."name" as section_name, u."name" as name, c."name" as class_name, u.aadhar_number, st.admission_number, s.id as section_id, c.id as class_id
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".users u on u.id = e.user_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".students st on st.user_id = u.id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21
|
|
-- and u.name like '%maya%'
|
|
-- or st.admission_number like '%maya%'
|
|
-- or u.aadhar_number like '%maya%'
|
|
-------------------------------------------
|
|
-- SECTIONS
|
|
-------------------------------------------
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21;
|
|
-------------------------------------------
|
|
-- OTHER
|
|
-------------------------------------------
|
|
|
|
select * (
|
|
select
|
|
sum(pi.amount) as amount_paid
|
|
from
|
|
"tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payments p
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e on e.id = p.enrolment_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payment_items pi on pi.payment_id = p.id
|
|
where
|
|
c.academic_year_id = 21
|
|
) t
|
|
|
|
2021-01-24 19:21:16.736 IST [61561] ERROR: syntax error at or near "(" at character 3372
|
|
2021-01-24 19:21:16.736 IST [61561] STATEMENT: -- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payment_items pi
|
|
-- left join "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payments p on p.id = pi.payment_id
|
|
-- where p.enrolment_id = 1
|
|
-- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".users where "name" LIKE '%afi%'
|
|
-- DROP schema "tnt_788478b3-dcc8-4b5f-b4ee-d51c861333ff" CASCADE;
|
|
-- select * from "tnt_cf809103-d949-4562-896e-bcef7c73e8d7".users where phone = '9705664434'
|
|
-- select * from "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments where user_id = 1340
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."enrolments"
|
|
-- where
|
|
-- exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "name" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "aadhar_number" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."students"
|
|
-- where
|
|
-- "users"."id" = "students"."user_id"
|
|
-- and "admission_number" :: text LIKE '%maya%'
|
|
-- )
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."sections"
|
|
-- where
|
|
-- "enrolments"."section_id" = "sections"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."classes"
|
|
-- where
|
|
-- "sections"."class_id" = "classes"."id"
|
|
-- and "academic_year_id" = 21
|
|
-- )
|
|
-- )
|
|
-- limit
|
|
-- 5
|
|
-------------------------------------------
|
|
-- AUTO COMPLETE
|
|
-------------------------------------------
|
|
-- select
|
|
-- u.id, s."name" as section_name, u."name" as name, c."name" as class_name, u.aadhar_number, st.admission_number, s.id as section_id, c.id as class_id
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".users u on u.id = e.user_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".students st on st.user_id = u.id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21
|
|
-- and u.name like '%maya%'
|
|
-- or st.admission_number like '%maya%'
|
|
-- or u.aadhar_number like '%maya%'
|
|
-------------------------------------------
|
|
-- SECTIONS
|
|
-------------------------------------------
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21;
|
|
-------------------------------------------
|
|
-- OTHER
|
|
-------------------------------------------
|
|
|
|
select * (
|
|
select
|
|
sum(pi.amount) as amount_paid
|
|
from
|
|
"tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payments p
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e on e.id = p.enrolment_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payment_items pi on pi.payment_id = p.id
|
|
where
|
|
c.academic_year_id = 21
|
|
) t
|
|
|
|
2021-01-24 19:26:28.793 IST [61561] ERROR: date/time field value out of range: "24-01-2021" at character 3877
|
|
2021-01-24 19:26:28.793 IST [61561] HINT: Perhaps you need a different "datestyle" setting.
|
|
2021-01-24 19:26:28.793 IST [61561] STATEMENT: -- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payment_items pi
|
|
-- left join "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payments p on p.id = pi.payment_id
|
|
-- where p.enrolment_id = 1
|
|
-- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".users where "name" LIKE '%afi%'
|
|
-- DROP schema "tnt_788478b3-dcc8-4b5f-b4ee-d51c861333ff" CASCADE;
|
|
-- select * from "tnt_cf809103-d949-4562-896e-bcef7c73e8d7".users where phone = '9705664434'
|
|
-- select * from "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments where user_id = 1340
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."enrolments"
|
|
-- where
|
|
-- exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "name" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "aadhar_number" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."students"
|
|
-- where
|
|
-- "users"."id" = "students"."user_id"
|
|
-- and "admission_number" :: text LIKE '%maya%'
|
|
-- )
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."sections"
|
|
-- where
|
|
-- "enrolments"."section_id" = "sections"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."classes"
|
|
-- where
|
|
-- "sections"."class_id" = "classes"."id"
|
|
-- and "academic_year_id" = 21
|
|
-- )
|
|
-- )
|
|
-- limit
|
|
-- 5
|
|
-------------------------------------------
|
|
-- AUTO COMPLETE
|
|
-------------------------------------------
|
|
-- select
|
|
-- u.id, s."name" as section_name, u."name" as name, c."name" as class_name, u.aadhar_number, st.admission_number, s.id as section_id, c.id as class_id
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".users u on u.id = e.user_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".students st on st.user_id = u.id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21
|
|
-- and u.name like '%maya%'
|
|
-- or st.admission_number like '%maya%'
|
|
-- or u.aadhar_number like '%maya%'
|
|
-------------------------------------------
|
|
-- SECTIONS
|
|
-------------------------------------------
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21;
|
|
-------------------------------------------
|
|
-- AMOUNT PAID BY Academic Year ID
|
|
-------------------------------------------
|
|
select
|
|
sum(pi.amount) as amount_paid
|
|
from
|
|
"tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payments p
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e on e.id = p.enrolment_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payment_items pi on pi.payment_id = p.id
|
|
where
|
|
c.created_at BETWEEN '01-06-2020' and '24-01-2021'
|
|
and c.academic_year_id = 21;
|
|
2021-01-24 19:31:46.134 IST [61561] ERROR: column fa.section_id does not exist at character 4320
|
|
2021-01-24 19:31:46.134 IST [61561] STATEMENT: -- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payment_items pi
|
|
-- left join "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payments p on p.id = pi.payment_id
|
|
-- where p.enrolment_id = 1
|
|
-- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".users where "name" LIKE '%afi%'
|
|
-- DROP schema "tnt_788478b3-dcc8-4b5f-b4ee-d51c861333ff" CASCADE;
|
|
-- select * from "tnt_cf809103-d949-4562-896e-bcef7c73e8d7".users where phone = '9705664434'
|
|
-- select * from "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments where user_id = 1340
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."enrolments"
|
|
-- where
|
|
-- exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "name" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "aadhar_number" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."students"
|
|
-- where
|
|
-- "users"."id" = "students"."user_id"
|
|
-- and "admission_number" :: text LIKE '%maya%'
|
|
-- )
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."sections"
|
|
-- where
|
|
-- "enrolments"."section_id" = "sections"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."classes"
|
|
-- where
|
|
-- "sections"."class_id" = "classes"."id"
|
|
-- and "academic_year_id" = 21
|
|
-- )
|
|
-- )
|
|
-- limit
|
|
-- 5
|
|
-------------------------------------------
|
|
-- AUTO COMPLETE
|
|
-------------------------------------------
|
|
-- select
|
|
-- u.id, s."name" as section_name, u."name" as name, c."name" as class_name, u.aadhar_number, st.admission_number, s.id as section_id, c.id as class_id
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".users u on u.id = e.user_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".students st on st.user_id = u.id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21
|
|
-- and u.name like '%maya%'
|
|
-- or st.admission_number like '%maya%'
|
|
-- or u.aadhar_number like '%maya%'
|
|
-------------------------------------------
|
|
-- SECTIONS
|
|
-------------------------------------------
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21;
|
|
-------------------------------------------
|
|
-- AMOUNT PAID BY Academic Year ID
|
|
-------------------------------------------
|
|
-- select
|
|
-- sum(pi.amount) as amount_paid
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payments p
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e on e.id = p.enrolment_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payment_items pi on pi.payment_id = p.id
|
|
-- where
|
|
-- p.created_at BETWEEN '2019-06-01'
|
|
-- and '2021-01-24'
|
|
-- and c.academic_year_id = 21;
|
|
-------------------------------------------
|
|
-- AMOUNT PAID BY Academic Year ID
|
|
-------------------------------------------
|
|
|
|
SELECT
|
|
*
|
|
FROM
|
|
"tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".fee_assignments fa
|
|
JOIN "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s ON s.id = fa.feeable_id
|
|
AND fa.feeable_type = 'section'
|
|
WHERE fa.academic_year_id = 21
|
|
group by fa.section_id
|
|
2021-01-24 19:31:57.880 IST [61561] ERROR: column "fa.id" must appear in the GROUP BY clause or be used in an aggregate function at character 4092
|
|
2021-01-24 19:31:57.880 IST [61561] STATEMENT: -- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payment_items pi
|
|
-- left join "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payments p on p.id = pi.payment_id
|
|
-- where p.enrolment_id = 1
|
|
-- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".users where "name" LIKE '%afi%'
|
|
-- DROP schema "tnt_788478b3-dcc8-4b5f-b4ee-d51c861333ff" CASCADE;
|
|
-- select * from "tnt_cf809103-d949-4562-896e-bcef7c73e8d7".users where phone = '9705664434'
|
|
-- select * from "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments where user_id = 1340
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."enrolments"
|
|
-- where
|
|
-- exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "name" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "aadhar_number" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."students"
|
|
-- where
|
|
-- "users"."id" = "students"."user_id"
|
|
-- and "admission_number" :: text LIKE '%maya%'
|
|
-- )
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."sections"
|
|
-- where
|
|
-- "enrolments"."section_id" = "sections"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."classes"
|
|
-- where
|
|
-- "sections"."class_id" = "classes"."id"
|
|
-- and "academic_year_id" = 21
|
|
-- )
|
|
-- )
|
|
-- limit
|
|
-- 5
|
|
-------------------------------------------
|
|
-- AUTO COMPLETE
|
|
-------------------------------------------
|
|
-- select
|
|
-- u.id, s."name" as section_name, u."name" as name, c."name" as class_name, u.aadhar_number, st.admission_number, s.id as section_id, c.id as class_id
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".users u on u.id = e.user_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".students st on st.user_id = u.id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21
|
|
-- and u.name like '%maya%'
|
|
-- or st.admission_number like '%maya%'
|
|
-- or u.aadhar_number like '%maya%'
|
|
-------------------------------------------
|
|
-- SECTIONS
|
|
-------------------------------------------
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21;
|
|
-------------------------------------------
|
|
-- AMOUNT PAID BY Academic Year ID
|
|
-------------------------------------------
|
|
-- select
|
|
-- sum(pi.amount) as amount_paid
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payments p
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e on e.id = p.enrolment_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payment_items pi on pi.payment_id = p.id
|
|
-- where
|
|
-- p.created_at BETWEEN '2019-06-01'
|
|
-- and '2021-01-24'
|
|
-- and c.academic_year_id = 21;
|
|
-------------------------------------------
|
|
-- AMOUNT PAID BY Academic Year ID
|
|
-------------------------------------------
|
|
|
|
SELECT
|
|
*
|
|
FROM
|
|
"tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".fee_assignments fa
|
|
JOIN "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s ON s.id = fa.feeable_id
|
|
AND fa.feeable_type = 'section'
|
|
WHERE fa.academic_year_id = 21
|
|
group by s.id
|
|
2021-01-24 19:32:08.697 IST [61561] ERROR: missing FROM-clause entry for table "sa" at character 4096
|
|
2021-01-24 19:32:08.697 IST [61561] STATEMENT: -- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payment_items pi
|
|
-- left join "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payments p on p.id = pi.payment_id
|
|
-- where p.enrolment_id = 1
|
|
-- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".users where "name" LIKE '%afi%'
|
|
-- DROP schema "tnt_788478b3-dcc8-4b5f-b4ee-d51c861333ff" CASCADE;
|
|
-- select * from "tnt_cf809103-d949-4562-896e-bcef7c73e8d7".users where phone = '9705664434'
|
|
-- select * from "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments where user_id = 1340
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."enrolments"
|
|
-- where
|
|
-- exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "name" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "aadhar_number" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."students"
|
|
-- where
|
|
-- "users"."id" = "students"."user_id"
|
|
-- and "admission_number" :: text LIKE '%maya%'
|
|
-- )
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."sections"
|
|
-- where
|
|
-- "enrolments"."section_id" = "sections"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."classes"
|
|
-- where
|
|
-- "sections"."class_id" = "classes"."id"
|
|
-- and "academic_year_id" = 21
|
|
-- )
|
|
-- )
|
|
-- limit
|
|
-- 5
|
|
-------------------------------------------
|
|
-- AUTO COMPLETE
|
|
-------------------------------------------
|
|
-- select
|
|
-- u.id, s."name" as section_name, u."name" as name, c."name" as class_name, u.aadhar_number, st.admission_number, s.id as section_id, c.id as class_id
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".users u on u.id = e.user_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".students st on st.user_id = u.id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21
|
|
-- and u.name like '%maya%'
|
|
-- or st.admission_number like '%maya%'
|
|
-- or u.aadhar_number like '%maya%'
|
|
-------------------------------------------
|
|
-- SECTIONS
|
|
-------------------------------------------
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21;
|
|
-------------------------------------------
|
|
-- AMOUNT PAID BY Academic Year ID
|
|
-------------------------------------------
|
|
-- select
|
|
-- sum(pi.amount) as amount_paid
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payments p
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e on e.id = p.enrolment_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payment_items pi on pi.payment_id = p.id
|
|
-- where
|
|
-- p.created_at BETWEEN '2019-06-01'
|
|
-- and '2021-01-24'
|
|
-- and c.academic_year_id = 21;
|
|
-------------------------------------------
|
|
-- AMOUNT PAID BY Academic Year ID
|
|
-------------------------------------------
|
|
|
|
SELECT
|
|
*,
|
|
sa.id as section_id
|
|
FROM
|
|
"tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".fee_assignments fa
|
|
JOIN "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s ON s.id = fa.feeable_id
|
|
AND fa.feeable_type = 'section'
|
|
WHERE fa.academic_year_id = 21
|
|
group by s.id
|
|
2021-01-24 19:32:26.762 IST [61561] ERROR: column "fa.id" must appear in the GROUP BY clause or be used in an aggregate function at character 4092
|
|
2021-01-24 19:32:26.762 IST [61561] STATEMENT: -- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payment_items pi
|
|
-- left join "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payments p on p.id = pi.payment_id
|
|
-- where p.enrolment_id = 1
|
|
-- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".users where "name" LIKE '%afi%'
|
|
-- DROP schema "tnt_788478b3-dcc8-4b5f-b4ee-d51c861333ff" CASCADE;
|
|
-- select * from "tnt_cf809103-d949-4562-896e-bcef7c73e8d7".users where phone = '9705664434'
|
|
-- select * from "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments where user_id = 1340
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."enrolments"
|
|
-- where
|
|
-- exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "name" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "aadhar_number" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."students"
|
|
-- where
|
|
-- "users"."id" = "students"."user_id"
|
|
-- and "admission_number" :: text LIKE '%maya%'
|
|
-- )
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."sections"
|
|
-- where
|
|
-- "enrolments"."section_id" = "sections"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."classes"
|
|
-- where
|
|
-- "sections"."class_id" = "classes"."id"
|
|
-- and "academic_year_id" = 21
|
|
-- )
|
|
-- )
|
|
-- limit
|
|
-- 5
|
|
-------------------------------------------
|
|
-- AUTO COMPLETE
|
|
-------------------------------------------
|
|
-- select
|
|
-- u.id, s."name" as section_name, u."name" as name, c."name" as class_name, u.aadhar_number, st.admission_number, s.id as section_id, c.id as class_id
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".users u on u.id = e.user_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".students st on st.user_id = u.id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21
|
|
-- and u.name like '%maya%'
|
|
-- or st.admission_number like '%maya%'
|
|
-- or u.aadhar_number like '%maya%'
|
|
-------------------------------------------
|
|
-- SECTIONS
|
|
-------------------------------------------
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21;
|
|
-------------------------------------------
|
|
-- AMOUNT PAID BY Academic Year ID
|
|
-------------------------------------------
|
|
-- select
|
|
-- sum(pi.amount) as amount_paid
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payments p
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e on e.id = p.enrolment_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payment_items pi on pi.payment_id = p.id
|
|
-- where
|
|
-- p.created_at BETWEEN '2019-06-01'
|
|
-- and '2021-01-24'
|
|
-- and c.academic_year_id = 21;
|
|
-------------------------------------------
|
|
-- AMOUNT PAID BY Academic Year ID
|
|
-------------------------------------------
|
|
|
|
SELECT
|
|
*,
|
|
s.id as section_id
|
|
FROM
|
|
"tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".fee_assignments fa
|
|
JOIN "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s ON s.id = fa.feeable_id
|
|
AND fa.feeable_type = 'section'
|
|
WHERE fa.academic_year_id = 21
|
|
group by s.id
|
|
2021-01-24 19:33:03.940 IST [61561] ERROR: syntax error at or near "FROM" at character 4114
|
|
2021-01-24 19:33:03.940 IST [61561] STATEMENT: -- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payment_items pi
|
|
-- left join "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payments p on p.id = pi.payment_id
|
|
-- where p.enrolment_id = 1
|
|
-- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".users where "name" LIKE '%afi%'
|
|
-- DROP schema "tnt_788478b3-dcc8-4b5f-b4ee-d51c861333ff" CASCADE;
|
|
-- select * from "tnt_cf809103-d949-4562-896e-bcef7c73e8d7".users where phone = '9705664434'
|
|
-- select * from "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments where user_id = 1340
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."enrolments"
|
|
-- where
|
|
-- exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "name" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "aadhar_number" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."students"
|
|
-- where
|
|
-- "users"."id" = "students"."user_id"
|
|
-- and "admission_number" :: text LIKE '%maya%'
|
|
-- )
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."sections"
|
|
-- where
|
|
-- "enrolments"."section_id" = "sections"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."classes"
|
|
-- where
|
|
-- "sections"."class_id" = "classes"."id"
|
|
-- and "academic_year_id" = 21
|
|
-- )
|
|
-- )
|
|
-- limit
|
|
-- 5
|
|
-------------------------------------------
|
|
-- AUTO COMPLETE
|
|
-------------------------------------------
|
|
-- select
|
|
-- u.id, s."name" as section_name, u."name" as name, c."name" as class_name, u.aadhar_number, st.admission_number, s.id as section_id, c.id as class_id
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".users u on u.id = e.user_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".students st on st.user_id = u.id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21
|
|
-- and u.name like '%maya%'
|
|
-- or st.admission_number like '%maya%'
|
|
-- or u.aadhar_number like '%maya%'
|
|
-------------------------------------------
|
|
-- SECTIONS
|
|
-------------------------------------------
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21;
|
|
-------------------------------------------
|
|
-- AMOUNT PAID BY Academic Year ID
|
|
-------------------------------------------
|
|
-- select
|
|
-- sum(pi.amount) as amount_paid
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payments p
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e on e.id = p.enrolment_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payment_items pi on pi.payment_id = p.id
|
|
-- where
|
|
-- p.created_at BETWEEN '2019-06-01'
|
|
-- and '2021-01-24'
|
|
-- and c.academic_year_id = 21;
|
|
-------------------------------------------
|
|
-- AMOUNT PAID BY Academic Year ID
|
|
-------------------------------------------
|
|
|
|
SELECT
|
|
s.id as section_id,
|
|
|
|
FROM
|
|
"tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".fee_assignments fa
|
|
JOIN "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s ON s.id = fa.feeable_id
|
|
AND fa.feeable_type = 'section'
|
|
JOIN "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e on e.section_id = s.id
|
|
WHERE fa.academic_year_id = 21
|
|
group by s.id
|
|
2021-01-24 19:33:32.053 IST [61561] ERROR: column "fa.amount" must appear in the GROUP BY clause or be used in an aggregate function at character 4114
|
|
2021-01-24 19:33:32.053 IST [61561] STATEMENT: -- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payment_items pi
|
|
-- left join "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payments p on p.id = pi.payment_id
|
|
-- where p.enrolment_id = 1
|
|
-- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".users where "name" LIKE '%afi%'
|
|
-- DROP schema "tnt_788478b3-dcc8-4b5f-b4ee-d51c861333ff" CASCADE;
|
|
-- select * from "tnt_cf809103-d949-4562-896e-bcef7c73e8d7".users where phone = '9705664434'
|
|
-- select * from "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments where user_id = 1340
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."enrolments"
|
|
-- where
|
|
-- exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "name" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "aadhar_number" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."students"
|
|
-- where
|
|
-- "users"."id" = "students"."user_id"
|
|
-- and "admission_number" :: text LIKE '%maya%'
|
|
-- )
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."sections"
|
|
-- where
|
|
-- "enrolments"."section_id" = "sections"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."classes"
|
|
-- where
|
|
-- "sections"."class_id" = "classes"."id"
|
|
-- and "academic_year_id" = 21
|
|
-- )
|
|
-- )
|
|
-- limit
|
|
-- 5
|
|
-------------------------------------------
|
|
-- AUTO COMPLETE
|
|
-------------------------------------------
|
|
-- select
|
|
-- u.id, s."name" as section_name, u."name" as name, c."name" as class_name, u.aadhar_number, st.admission_number, s.id as section_id, c.id as class_id
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".users u on u.id = e.user_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".students st on st.user_id = u.id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21
|
|
-- and u.name like '%maya%'
|
|
-- or st.admission_number like '%maya%'
|
|
-- or u.aadhar_number like '%maya%'
|
|
-------------------------------------------
|
|
-- SECTIONS
|
|
-------------------------------------------
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21;
|
|
-------------------------------------------
|
|
-- AMOUNT PAID BY Academic Year ID
|
|
-------------------------------------------
|
|
-- select
|
|
-- sum(pi.amount) as amount_paid
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payments p
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e on e.id = p.enrolment_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payment_items pi on pi.payment_id = p.id
|
|
-- where
|
|
-- p.created_at BETWEEN '2019-06-01'
|
|
-- and '2021-01-24'
|
|
-- and c.academic_year_id = 21;
|
|
-------------------------------------------
|
|
-- AMOUNT PAID BY Academic Year ID
|
|
-------------------------------------------
|
|
SELECT
|
|
s.id as section_id,
|
|
fa.amount
|
|
FROM
|
|
"tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".fee_assignments fa
|
|
JOIN "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s ON s.id = fa.feeable_id
|
|
AND fa.feeable_type = 'section'
|
|
JOIN "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e on e.section_id = s.id
|
|
WHERE
|
|
fa.academic_year_id = 21
|
|
group by
|
|
s.id
|
|
2021-01-24 19:34:54.376 IST [61561] ERROR: missing FROM-clause entry for table "s" at character 4092
|
|
2021-01-24 19:34:54.376 IST [61561] STATEMENT: -- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payment_items pi
|
|
-- left join "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payments p on p.id = pi.payment_id
|
|
-- where p.enrolment_id = 1
|
|
-- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".users where "name" LIKE '%afi%'
|
|
-- DROP schema "tnt_788478b3-dcc8-4b5f-b4ee-d51c861333ff" CASCADE;
|
|
-- select * from "tnt_cf809103-d949-4562-896e-bcef7c73e8d7".users where phone = '9705664434'
|
|
-- select * from "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments where user_id = 1340
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."enrolments"
|
|
-- where
|
|
-- exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "name" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "aadhar_number" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."students"
|
|
-- where
|
|
-- "users"."id" = "students"."user_id"
|
|
-- and "admission_number" :: text LIKE '%maya%'
|
|
-- )
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."sections"
|
|
-- where
|
|
-- "enrolments"."section_id" = "sections"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."classes"
|
|
-- where
|
|
-- "sections"."class_id" = "classes"."id"
|
|
-- and "academic_year_id" = 21
|
|
-- )
|
|
-- )
|
|
-- limit
|
|
-- 5
|
|
-------------------------------------------
|
|
-- AUTO COMPLETE
|
|
-------------------------------------------
|
|
-- select
|
|
-- u.id, s."name" as section_name, u."name" as name, c."name" as class_name, u.aadhar_number, st.admission_number, s.id as section_id, c.id as class_id
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".users u on u.id = e.user_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".students st on st.user_id = u.id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21
|
|
-- and u.name like '%maya%'
|
|
-- or st.admission_number like '%maya%'
|
|
-- or u.aadhar_number like '%maya%'
|
|
-------------------------------------------
|
|
-- SECTIONS
|
|
-------------------------------------------
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21;
|
|
-------------------------------------------
|
|
-- AMOUNT PAID BY Academic Year ID
|
|
-------------------------------------------
|
|
-- select
|
|
-- sum(pi.amount) as amount_paid
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payments p
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e on e.id = p.enrolment_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payment_items pi on pi.payment_id = p.id
|
|
-- where
|
|
-- p.created_at BETWEEN '2019-06-01'
|
|
-- and '2021-01-24'
|
|
-- and c.academic_year_id = 21;
|
|
-------------------------------------------
|
|
-- AMOUNT PAID BY Academic Year ID
|
|
-------------------------------------------
|
|
SELECT
|
|
s.id as section_id,
|
|
sum(fa.amount),
|
|
count(e.id) as enrolments
|
|
FROM
|
|
"tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".fee_assignments fa
|
|
|
|
JOIN "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e on e.section_id = fa.feeable_id
|
|
WHERE
|
|
fa.academic_year_id = 21
|
|
group by
|
|
s.id
|
|
2021-01-24 19:34:58.732 IST [61561] ERROR: missing FROM-clause entry for table "s" at character 4370
|
|
2021-01-24 19:34:58.732 IST [61561] STATEMENT: -- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payment_items pi
|
|
-- left join "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payments p on p.id = pi.payment_id
|
|
-- where p.enrolment_id = 1
|
|
-- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".users where "name" LIKE '%afi%'
|
|
-- DROP schema "tnt_788478b3-dcc8-4b5f-b4ee-d51c861333ff" CASCADE;
|
|
-- select * from "tnt_cf809103-d949-4562-896e-bcef7c73e8d7".users where phone = '9705664434'
|
|
-- select * from "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments where user_id = 1340
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."enrolments"
|
|
-- where
|
|
-- exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "name" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "aadhar_number" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."students"
|
|
-- where
|
|
-- "users"."id" = "students"."user_id"
|
|
-- and "admission_number" :: text LIKE '%maya%'
|
|
-- )
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."sections"
|
|
-- where
|
|
-- "enrolments"."section_id" = "sections"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."classes"
|
|
-- where
|
|
-- "sections"."class_id" = "classes"."id"
|
|
-- and "academic_year_id" = 21
|
|
-- )
|
|
-- )
|
|
-- limit
|
|
-- 5
|
|
-------------------------------------------
|
|
-- AUTO COMPLETE
|
|
-------------------------------------------
|
|
-- select
|
|
-- u.id, s."name" as section_name, u."name" as name, c."name" as class_name, u.aadhar_number, st.admission_number, s.id as section_id, c.id as class_id
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".users u on u.id = e.user_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".students st on st.user_id = u.id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21
|
|
-- and u.name like '%maya%'
|
|
-- or st.admission_number like '%maya%'
|
|
-- or u.aadhar_number like '%maya%'
|
|
-------------------------------------------
|
|
-- SECTIONS
|
|
-------------------------------------------
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21;
|
|
-------------------------------------------
|
|
-- AMOUNT PAID BY Academic Year ID
|
|
-------------------------------------------
|
|
-- select
|
|
-- sum(pi.amount) as amount_paid
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payments p
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e on e.id = p.enrolment_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payment_items pi on pi.payment_id = p.id
|
|
-- where
|
|
-- p.created_at BETWEEN '2019-06-01'
|
|
-- and '2021-01-24'
|
|
-- and c.academic_year_id = 21;
|
|
-------------------------------------------
|
|
-- AMOUNT PAID BY Academic Year ID
|
|
-------------------------------------------
|
|
SELECT
|
|
-- s.id as section_id,
|
|
sum(fa.amount),
|
|
count(e.id) as enrolments
|
|
FROM
|
|
"tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".fee_assignments fa
|
|
|
|
JOIN "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e on e.section_id = fa.feeable_id
|
|
WHERE
|
|
fa.academic_year_id = 21
|
|
group by
|
|
s.id
|
|
2021-01-24 19:48:33.759 IST [61561] ERROR: column "e.section_id" must appear in the GROUP BY clause or be used in an aggregate function at character 3402
|
|
2021-01-24 19:48:33.759 IST [61561] STATEMENT: -- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payment_items pi
|
|
-- left join "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payments p on p.id = pi.payment_id
|
|
-- where p.enrolment_id = 1
|
|
-- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".users where "name" LIKE '%afi%'
|
|
-- DROP schema "tnt_788478b3-dcc8-4b5f-b4ee-d51c861333ff" CASCADE;
|
|
-- select * from "tnt_cf809103-d949-4562-896e-bcef7c73e8d7".users where phone = '9705664434'
|
|
-- select * from "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments where user_id = 1340
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."enrolments"
|
|
-- where
|
|
-- exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "name" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "aadhar_number" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."students"
|
|
-- where
|
|
-- "users"."id" = "students"."user_id"
|
|
-- and "admission_number" :: text LIKE '%maya%'
|
|
-- )
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."sections"
|
|
-- where
|
|
-- "enrolments"."section_id" = "sections"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."classes"
|
|
-- where
|
|
-- "sections"."class_id" = "classes"."id"
|
|
-- and "academic_year_id" = 21
|
|
-- )
|
|
-- )
|
|
-- limit
|
|
-- 5
|
|
-------------------------------------------
|
|
-- AUTO COMPLETE
|
|
-------------------------------------------
|
|
-- select
|
|
-- u.id, s."name" as section_name, u."name" as name, c."name" as class_name, u.aadhar_number, st.admission_number, s.id as section_id, c.id as class_id
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".users u on u.id = e.user_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".students st on st.user_id = u.id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21
|
|
-- and u.name like '%maya%'
|
|
-- or st.admission_number like '%maya%'
|
|
-- or u.aadhar_number like '%maya%'
|
|
-------------------------------------------
|
|
-- SECTIONS
|
|
-------------------------------------------
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21;
|
|
-------------------------------------------
|
|
-- AMOUNT PAID BY Academic Year ID
|
|
-------------------------------------------
|
|
select
|
|
p.*,
|
|
e.section_id,
|
|
c.id as class_id,
|
|
c.academic_year_id
|
|
-- sum(pi.amount) as amount_paid
|
|
from
|
|
"tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payments p
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e on e.id = p.enrolment_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payment_items pi on pi.payment_id = p.id
|
|
where
|
|
p.created_at BETWEEN '2019-06-01'
|
|
and '2021-01-24'
|
|
and p.status = 'paid'
|
|
and s.id in (4)
|
|
and c.academic_year_id = 21
|
|
group by p.id;
|
|
2021-01-24 19:48:59.558 IST [61561] ERROR: column "c.id" must appear in the GROUP BY clause or be used in an aggregate function at character 3420
|
|
2021-01-24 19:48:59.558 IST [61561] STATEMENT: -- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payment_items pi
|
|
-- left join "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payments p on p.id = pi.payment_id
|
|
-- where p.enrolment_id = 1
|
|
-- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".users where "name" LIKE '%afi%'
|
|
-- DROP schema "tnt_788478b3-dcc8-4b5f-b4ee-d51c861333ff" CASCADE;
|
|
-- select * from "tnt_cf809103-d949-4562-896e-bcef7c73e8d7".users where phone = '9705664434'
|
|
-- select * from "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments where user_id = 1340
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."enrolments"
|
|
-- where
|
|
-- exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "name" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "aadhar_number" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."students"
|
|
-- where
|
|
-- "users"."id" = "students"."user_id"
|
|
-- and "admission_number" :: text LIKE '%maya%'
|
|
-- )
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."sections"
|
|
-- where
|
|
-- "enrolments"."section_id" = "sections"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."classes"
|
|
-- where
|
|
-- "sections"."class_id" = "classes"."id"
|
|
-- and "academic_year_id" = 21
|
|
-- )
|
|
-- )
|
|
-- limit
|
|
-- 5
|
|
-------------------------------------------
|
|
-- AUTO COMPLETE
|
|
-------------------------------------------
|
|
-- select
|
|
-- u.id, s."name" as section_name, u."name" as name, c."name" as class_name, u.aadhar_number, st.admission_number, s.id as section_id, c.id as class_id
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".users u on u.id = e.user_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".students st on st.user_id = u.id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21
|
|
-- and u.name like '%maya%'
|
|
-- or st.admission_number like '%maya%'
|
|
-- or u.aadhar_number like '%maya%'
|
|
-------------------------------------------
|
|
-- SECTIONS
|
|
-------------------------------------------
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21;
|
|
-------------------------------------------
|
|
-- AMOUNT PAID BY Academic Year ID
|
|
-------------------------------------------
|
|
select
|
|
p.*,
|
|
-- e.section_id,
|
|
c.id as class_id,
|
|
c.academic_year_id
|
|
-- sum(pi.amount) as amount_paid
|
|
from
|
|
"tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payments p
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e on e.id = p.enrolment_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payment_items pi on pi.payment_id = p.id
|
|
where
|
|
p.created_at BETWEEN '2019-06-01'
|
|
and '2021-01-24'
|
|
and p.status = 'paid'
|
|
and s.id in (4)
|
|
and c.academic_year_id = 21
|
|
group by p.id;
|
|
2021-01-24 19:49:05.206 IST [61561] ERROR: syntax error at or near "from" at character 3499
|
|
2021-01-24 19:49:05.206 IST [61561] STATEMENT: -- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payment_items pi
|
|
-- left join "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payments p on p.id = pi.payment_id
|
|
-- where p.enrolment_id = 1
|
|
-- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".users where "name" LIKE '%afi%'
|
|
-- DROP schema "tnt_788478b3-dcc8-4b5f-b4ee-d51c861333ff" CASCADE;
|
|
-- select * from "tnt_cf809103-d949-4562-896e-bcef7c73e8d7".users where phone = '9705664434'
|
|
-- select * from "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments where user_id = 1340
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."enrolments"
|
|
-- where
|
|
-- exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "name" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "aadhar_number" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."students"
|
|
-- where
|
|
-- "users"."id" = "students"."user_id"
|
|
-- and "admission_number" :: text LIKE '%maya%'
|
|
-- )
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."sections"
|
|
-- where
|
|
-- "enrolments"."section_id" = "sections"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."classes"
|
|
-- where
|
|
-- "sections"."class_id" = "classes"."id"
|
|
-- and "academic_year_id" = 21
|
|
-- )
|
|
-- )
|
|
-- limit
|
|
-- 5
|
|
-------------------------------------------
|
|
-- AUTO COMPLETE
|
|
-------------------------------------------
|
|
-- select
|
|
-- u.id, s."name" as section_name, u."name" as name, c."name" as class_name, u.aadhar_number, st.admission_number, s.id as section_id, c.id as class_id
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".users u on u.id = e.user_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".students st on st.user_id = u.id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21
|
|
-- and u.name like '%maya%'
|
|
-- or st.admission_number like '%maya%'
|
|
-- or u.aadhar_number like '%maya%'
|
|
-------------------------------------------
|
|
-- SECTIONS
|
|
-------------------------------------------
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21;
|
|
-------------------------------------------
|
|
-- AMOUNT PAID BY Academic Year ID
|
|
-------------------------------------------
|
|
select
|
|
p.*,
|
|
-- e.section_id,
|
|
-- c.id as class_id,
|
|
-- c.academic_year_id
|
|
-- sum(pi.amount) as amount_paid
|
|
from
|
|
"tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payments p
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e on e.id = p.enrolment_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payment_items pi on pi.payment_id = p.id
|
|
where
|
|
p.created_at BETWEEN '2019-06-01'
|
|
and '2021-01-24'
|
|
and p.status = 'paid'
|
|
and s.id in (4)
|
|
and c.academic_year_id = 21
|
|
group by p.id;
|
|
2021-01-24 19:49:54.422 IST [61561] ERROR: column "pi.amount" must appear in the GROUP BY clause or be used in an aggregate function at character 3439
|
|
2021-01-24 19:49:54.422 IST [61561] STATEMENT: -- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payment_items pi
|
|
-- left join "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payments p on p.id = pi.payment_id
|
|
-- where p.enrolment_id = 1
|
|
-- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".users where "name" LIKE '%afi%'
|
|
-- DROP schema "tnt_788478b3-dcc8-4b5f-b4ee-d51c861333ff" CASCADE;
|
|
-- select * from "tnt_cf809103-d949-4562-896e-bcef7c73e8d7".users where phone = '9705664434'
|
|
-- select * from "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments where user_id = 1340
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."enrolments"
|
|
-- where
|
|
-- exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "name" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "aadhar_number" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."students"
|
|
-- where
|
|
-- "users"."id" = "students"."user_id"
|
|
-- and "admission_number" :: text LIKE '%maya%'
|
|
-- )
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."sections"
|
|
-- where
|
|
-- "enrolments"."section_id" = "sections"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."classes"
|
|
-- where
|
|
-- "sections"."class_id" = "classes"."id"
|
|
-- and "academic_year_id" = 21
|
|
-- )
|
|
-- )
|
|
-- limit
|
|
-- 5
|
|
-------------------------------------------
|
|
-- AUTO COMPLETE
|
|
-------------------------------------------
|
|
-- select
|
|
-- u.id, s."name" as section_name, u."name" as name, c."name" as class_name, u.aadhar_number, st.admission_number, s.id as section_id, c.id as class_id
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".users u on u.id = e.user_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".students st on st.user_id = u.id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21
|
|
-- and u.name like '%maya%'
|
|
-- or st.admission_number like '%maya%'
|
|
-- or u.aadhar_number like '%maya%'
|
|
-------------------------------------------
|
|
-- SECTIONS
|
|
-------------------------------------------
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21;
|
|
-------------------------------------------
|
|
-- AMOUNT PAID BY Academic Year ID
|
|
-------------------------------------------
|
|
select
|
|
p.*
|
|
-- , sum(pi.amount) as paid_amount
|
|
, pi.amount
|
|
-- e.section_id,
|
|
-- c.id as class_id,
|
|
-- c.academic_year_id
|
|
-- sum(pi.amount) as amount_paid
|
|
from
|
|
"tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payments p
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e on e.id = p.enrolment_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payment_items pi on pi.payment_id = p.id
|
|
where
|
|
p.created_at BETWEEN '2019-06-01'
|
|
and '2021-01-24'
|
|
and p.status = 'paid'
|
|
and s.id in (4)
|
|
and c.academic_year_id = 21
|
|
group by p.id;
|
|
2021-01-24 19:50:10.578 IST [61561] ERROR: syntax error at or near "e" at character 3435
|
|
2021-01-24 19:50:10.578 IST [61561] STATEMENT: -- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payment_items pi
|
|
-- left join "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payments p on p.id = pi.payment_id
|
|
-- where p.enrolment_id = 1
|
|
-- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".users where "name" LIKE '%afi%'
|
|
-- DROP schema "tnt_788478b3-dcc8-4b5f-b4ee-d51c861333ff" CASCADE;
|
|
-- select * from "tnt_cf809103-d949-4562-896e-bcef7c73e8d7".users where phone = '9705664434'
|
|
-- select * from "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments where user_id = 1340
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."enrolments"
|
|
-- where
|
|
-- exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "name" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "aadhar_number" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."students"
|
|
-- where
|
|
-- "users"."id" = "students"."user_id"
|
|
-- and "admission_number" :: text LIKE '%maya%'
|
|
-- )
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."sections"
|
|
-- where
|
|
-- "enrolments"."section_id" = "sections"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."classes"
|
|
-- where
|
|
-- "sections"."class_id" = "classes"."id"
|
|
-- and "academic_year_id" = 21
|
|
-- )
|
|
-- )
|
|
-- limit
|
|
-- 5
|
|
-------------------------------------------
|
|
-- AUTO COMPLETE
|
|
-------------------------------------------
|
|
-- select
|
|
-- u.id, s."name" as section_name, u."name" as name, c."name" as class_name, u.aadhar_number, st.admission_number, s.id as section_id, c.id as class_id
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".users u on u.id = e.user_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".students st on st.user_id = u.id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21
|
|
-- and u.name like '%maya%'
|
|
-- or st.admission_number like '%maya%'
|
|
-- or u.aadhar_number like '%maya%'
|
|
-------------------------------------------
|
|
-- SECTIONS
|
|
-------------------------------------------
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21;
|
|
-------------------------------------------
|
|
-- AMOUNT PAID BY Academic Year ID
|
|
-------------------------------------------
|
|
select
|
|
p.*
|
|
, sum(pi.amount) as paid_amount
|
|
e.section_id,
|
|
-- c.id as class_id,
|
|
-- c.academic_year_id
|
|
-- sum(pi.amount) as amount_paid
|
|
from
|
|
"tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payments p
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e on e.id = p.enrolment_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payment_items pi on pi.payment_id = p.id
|
|
where
|
|
p.created_at BETWEEN '2019-06-01'
|
|
and '2021-01-24'
|
|
and p.status = 'paid'
|
|
and s.id in (4)
|
|
and c.academic_year_id = 21
|
|
group by p.id;
|
|
2021-01-24 19:50:16.778 IST [61561] ERROR: syntax error at or near "e" at character 3435
|
|
2021-01-24 19:50:16.778 IST [61561] STATEMENT: -- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payment_items pi
|
|
-- left join "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payments p on p.id = pi.payment_id
|
|
-- where p.enrolment_id = 1
|
|
-- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".users where "name" LIKE '%afi%'
|
|
-- DROP schema "tnt_788478b3-dcc8-4b5f-b4ee-d51c861333ff" CASCADE;
|
|
-- select * from "tnt_cf809103-d949-4562-896e-bcef7c73e8d7".users where phone = '9705664434'
|
|
-- select * from "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments where user_id = 1340
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."enrolments"
|
|
-- where
|
|
-- exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "name" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "aadhar_number" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."students"
|
|
-- where
|
|
-- "users"."id" = "students"."user_id"
|
|
-- and "admission_number" :: text LIKE '%maya%'
|
|
-- )
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."sections"
|
|
-- where
|
|
-- "enrolments"."section_id" = "sections"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."classes"
|
|
-- where
|
|
-- "sections"."class_id" = "classes"."id"
|
|
-- and "academic_year_id" = 21
|
|
-- )
|
|
-- )
|
|
-- limit
|
|
-- 5
|
|
-------------------------------------------
|
|
-- AUTO COMPLETE
|
|
-------------------------------------------
|
|
-- select
|
|
-- u.id, s."name" as section_name, u."name" as name, c."name" as class_name, u.aadhar_number, st.admission_number, s.id as section_id, c.id as class_id
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".users u on u.id = e.user_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".students st on st.user_id = u.id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21
|
|
-- and u.name like '%maya%'
|
|
-- or st.admission_number like '%maya%'
|
|
-- or u.aadhar_number like '%maya%'
|
|
-------------------------------------------
|
|
-- SECTIONS
|
|
-------------------------------------------
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21;
|
|
-------------------------------------------
|
|
-- AMOUNT PAID BY Academic Year ID
|
|
-------------------------------------------
|
|
select
|
|
p.*
|
|
, sum(pi.amount) as paid_amount
|
|
e.section_id,
|
|
-- c.id as class_id,
|
|
-- c.academic_year_id
|
|
-- sum(pi.amount) as amount_paid
|
|
from
|
|
"tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payments p
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e on e.id = p.enrolment_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payment_items pi on pi.payment_id = p.id
|
|
where
|
|
p.created_at BETWEEN '2019-06-01'
|
|
and '2021-01-24'
|
|
and p.status = 'paid'
|
|
and s.id in (4)
|
|
and c.academic_year_id = 21
|
|
group by p.id, e.section_id;
|
|
2021-01-24 19:51:33.455 IST [61561] ERROR: syntax error at or near "," at character 3433
|
|
2021-01-24 19:51:33.455 IST [61561] STATEMENT: -- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payment_items pi
|
|
-- left join "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payments p on p.id = pi.payment_id
|
|
-- where p.enrolment_id = 1
|
|
-- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".users where "name" LIKE '%afi%'
|
|
-- DROP schema "tnt_788478b3-dcc8-4b5f-b4ee-d51c861333ff" CASCADE;
|
|
-- select * from "tnt_cf809103-d949-4562-896e-bcef7c73e8d7".users where phone = '9705664434'
|
|
-- select * from "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments where user_id = 1340
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."enrolments"
|
|
-- where
|
|
-- exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "name" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "aadhar_number" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."students"
|
|
-- where
|
|
-- "users"."id" = "students"."user_id"
|
|
-- and "admission_number" :: text LIKE '%maya%'
|
|
-- )
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."sections"
|
|
-- where
|
|
-- "enrolments"."section_id" = "sections"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."classes"
|
|
-- where
|
|
-- "sections"."class_id" = "classes"."id"
|
|
-- and "academic_year_id" = 21
|
|
-- )
|
|
-- )
|
|
-- limit
|
|
-- 5
|
|
-------------------------------------------
|
|
-- AUTO COMPLETE
|
|
-------------------------------------------
|
|
-- select
|
|
-- u.id, s."name" as section_name, u."name" as name, c."name" as class_name, u.aadhar_number, st.admission_number, s.id as section_id, c.id as class_id
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".users u on u.id = e.user_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".students st on st.user_id = u.id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21
|
|
-- and u.name like '%maya%'
|
|
-- or st.admission_number like '%maya%'
|
|
-- or u.aadhar_number like '%maya%'
|
|
-------------------------------------------
|
|
-- SECTIONS
|
|
-------------------------------------------
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21;
|
|
-------------------------------------------
|
|
-- AMOUNT PAID BY Academic Year ID
|
|
-------------------------------------------
|
|
select
|
|
p.id
|
|
, s.class_id
|
|
, e.section_id,
|
|
, p.enrolment_id
|
|
, sum(pi.amount) as paid_amount
|
|
|
|
-- c.id as class_id,
|
|
-- c.academic_year_id
|
|
-- sum(pi.amount) as amount_paid
|
|
from
|
|
"tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payments p
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e on e.id = p.enrolment_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payment_items pi on pi.payment_id = p.id
|
|
where
|
|
p.created_at BETWEEN '2019-06-01'
|
|
and '2021-01-24'
|
|
and p.status = 'paid'
|
|
and s.id in (4)
|
|
and c.academic_year_id = 21
|
|
group by p.id, s.class_id, e.section_id, p.enrolment_id;
|
|
2021-01-24 19:52:33.123 IST [61561] ERROR: column "c.academic_year_id" must appear in the GROUP BY clause or be used in an aggregate function at character 3486
|
|
2021-01-24 19:52:33.123 IST [61561] STATEMENT: -- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payment_items pi
|
|
-- left join "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".payments p on p.id = pi.payment_id
|
|
-- where p.enrolment_id = 1
|
|
-- select * from "tnt_fadab5cd-0384-403b-a152-1e7592084ab4".users where "name" LIKE '%afi%'
|
|
-- DROP schema "tnt_788478b3-dcc8-4b5f-b4ee-d51c861333ff" CASCADE;
|
|
-- select * from "tnt_cf809103-d949-4562-896e-bcef7c73e8d7".users where phone = '9705664434'
|
|
-- select * from "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments where user_id = 1340
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."enrolments"
|
|
-- where
|
|
-- exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "name" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and "aadhar_number" :: text LIKE '%maya%'
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- or exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."users"
|
|
-- where
|
|
-- "enrolments"."user_id" = "users"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."students"
|
|
-- where
|
|
-- "users"."id" = "students"."user_id"
|
|
-- and "admission_number" :: text LIKE '%maya%'
|
|
-- )
|
|
-- and "users"."deleted_at" is null
|
|
-- )
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."sections"
|
|
-- where
|
|
-- "enrolments"."section_id" = "sections"."id"
|
|
-- and exists (
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."classes"
|
|
-- where
|
|
-- "sections"."class_id" = "classes"."id"
|
|
-- and "academic_year_id" = 21
|
|
-- )
|
|
-- )
|
|
-- limit
|
|
-- 5
|
|
-------------------------------------------
|
|
-- AUTO COMPLETE
|
|
-------------------------------------------
|
|
-- select
|
|
-- u.id, s."name" as section_name, u."name" as name, c."name" as class_name, u.aadhar_number, st.admission_number, s.id as section_id, c.id as class_id
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".users u on u.id = e.user_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".students st on st.user_id = u.id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21
|
|
-- and u.name like '%maya%'
|
|
-- or st.admission_number like '%maya%'
|
|
-- or u.aadhar_number like '%maya%'
|
|
-------------------------------------------
|
|
-- SECTIONS
|
|
-------------------------------------------
|
|
-- select
|
|
-- *
|
|
-- from
|
|
-- "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s
|
|
-- join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
-- where
|
|
-- c.academic_year_id = 21;
|
|
-------------------------------------------
|
|
-- AMOUNT PAID BY Academic Year ID
|
|
-------------------------------------------
|
|
select
|
|
p.id
|
|
, s.class_id
|
|
, e.section_id
|
|
, p.enrolment_id
|
|
, sum(pi.amount) as paid_amount
|
|
, c.academic_year_id
|
|
-- c.id as class_id,
|
|
-- c.academic_year_id
|
|
-- sum(pi.amount) as amount_paid
|
|
from
|
|
"tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payments p
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".enrolments e on e.id = p.enrolment_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".sections s on s.id = e.section_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".classes c on c.id = s.class_id
|
|
join "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1".payment_items pi on pi.payment_id = p.id
|
|
where
|
|
p.created_at BETWEEN '2019-06-01'
|
|
and '2021-01-24'
|
|
and p.status = 'paid'
|
|
and s.id in (4)
|
|
and c.academic_year_id = 21
|
|
group by p.id, s.class_id, e.section_id, p.enrolment_id;
|
|
2021-01-24 19:56:39.082 IST [61561] ERROR: relation "payments" does not exist at character 225
|
|
2021-01-24 19:56:39.082 IST [61561] STATEMENT: select
|
|
p.id as payment_id,
|
|
p.type,
|
|
p.mode,
|
|
p.status,
|
|
p.dd_cheque_number,
|
|
s.class_id,
|
|
e.section_id,
|
|
p.enrolment_id,
|
|
sum(pi.amount) as paid_amount,
|
|
c.academic_year_id,
|
|
p.created_at,
|
|
p.updated_at
|
|
from
|
|
payments p
|
|
join enrolments e on e.id = p.enrolment_id
|
|
join sections s on s.id = e.section_id
|
|
join classes c on c.id = s.class_id
|
|
join payment_items pi on pi.payment_id = p.id
|
|
group by
|
|
p.id,
|
|
s.class_id,
|
|
e.section_id,
|
|
p.enrolment_id,
|
|
c.academic_year_id;
|
|
2021-01-24 19:57:21.731 IST [61561] ERROR: relation "payments" does not exist at character 244
|
|
2021-01-24 19:57:21.731 IST [61561] STATEMENT: CREATE VIEW payments_view AS
|
|
SELECT
|
|
p.id AS payment_id,
|
|
p.type,
|
|
p.mode,
|
|
p.status,
|
|
p.dd_cheque_number,
|
|
s.class_id,
|
|
e.section_id,
|
|
p.enrolment_id,
|
|
sum(
|
|
pi.amount) AS paid_amount,
|
|
c.academic_year_id,
|
|
p.created_at,
|
|
p.updated_at
|
|
FROM
|
|
payments p
|
|
JOIN enrolments e ON e.id = p.enrolment_id
|
|
JOIN sections s ON s.id = e.section_id
|
|
JOIN classes c ON c.id = s.class_id
|
|
JOIN payment_items pi ON pi.payment_id = p.id
|
|
GROUP BY
|
|
p.id,
|
|
s.class_id,
|
|
e.section_id,
|
|
p.enrolment_id,
|
|
c.academic_year_id;
|
|
2021-01-24 19:57:48.605 IST [61561] ERROR: invalid input syntax for type oid: "" at character 1397
|
|
2021-01-24 19:57:48.605 IST [61561] STATEMENT: SELECT c.conname AS constraint_name,(SELECT STRING_AGG(QUOTE_IDENT(a.attname),','ORDER BY t.seq)FROM(SELECT ROW_NUMBER()OVER(ROWS UNBOUNDED PRECEDING)AS seq,attnum FROM UNNEST(c.conkey)AS t(attnum))AS t INNER JOIN pg_attribute AS a ON a.attrelid=c.conrelid AND a.attnum=t.attnum)AS child_column,tt.schema as parent_schema,tt.name AS parent_name,(SELECT STRING_AGG(QUOTE_IDENT(a.attname),','ORDER BY t.seq)FROM(SELECT ROW_NUMBER()OVER(ROWS UNBOUNDED PRECEDING)AS seq,attnum FROM UNNEST(c.confkey)AS t(attnum))AS t INNER JOIN pg_attribute AS a ON a.attrelid=c.confrelid AND a.attnum=t.attnum)AS parent_column,CASE confupdtype WHEN'r'THEN'restrict'WHEN'c'THEN'cascade'WHEN'n'THEN'set null'WHEN'd'THEN'set default'WHEN'a'THEN'no action'ELSE NULL END AS on_update,CASE confdeltype WHEN'r'THEN'restrict'WHEN'c'THEN'cascade'WHEN'n'THEN'set null'WHEN'd'THEN'set default'WHEN'a'THEN'no action'ELSE NULL END AS on_delete FROM pg_catalog.pg_constraint AS c INNER JOIN(SELECT pg_class.oid,QUOTE_IDENT(pg_namespace.nspname)as schema,QUOTE_IDENT(pg_class.relname)AS name FROM pg_class INNER JOIN pg_namespace ON pg_class.relnamespace=pg_namespace.oid)AS tf ON tf.oid=c.conrelid INNER JOIN(SELECT pg_class.oid,QUOTE_IDENT(pg_namespace.nspname)as schema,QUOTE_IDENT(pg_class.relname)AS name FROM pg_class INNER JOIN pg_namespace ON pg_class.relnamespace=pg_namespace.oid)AS tt ON tt.oid=c.confrelid WHERE tf.oid='' AND c.contype='f';
|
|
2021-01-24 19:58:16.168 IST [61561] ERROR: relation "payments" does not exist at character 286
|
|
2021-01-24 19:58:16.168 IST [61561] STATEMENT: CREATE VIEW "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."payments_view" AS SELECT
|
|
p.id AS payment_id,
|
|
p.type,
|
|
p.mode,
|
|
p.status,
|
|
p.dd_cheque_number,
|
|
s.class_id,
|
|
e.section_id,
|
|
p.enrolment_id,
|
|
sum(pi.amount) AS paid_amount,
|
|
c.academic_year_id,
|
|
p.created_at,
|
|
p.updated_at
|
|
FROM
|
|
payments p
|
|
JOIN enrolments e ON e.id = p.enrolment_id
|
|
JOIN sections s ON s.id = e.section_id
|
|
JOIN classes c ON c.id = s.class_id
|
|
JOIN payment_items pi ON pi.payment_id = p.id
|
|
GROUP BY
|
|
p.id,
|
|
s.class_id,
|
|
e.section_id,
|
|
p.enrolment_id,
|
|
c.academic_year_id;
|
|
2021-01-25 00:02:22.238 IST [61561] ERROR: duplicate key value violates unique constraint "terms_pkey"
|
|
2021-01-25 00:02:22.238 IST [61561] DETAIL: Key (id)=(4) already exists.
|
|
2021-01-25 00:02:22.238 IST [61561] STATEMENT: UPDATE "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."terms" SET "id" = '4' WHERE "id" = '11';
|
|
2021-01-25 00:02:51.913 IST [61561] ERROR: duplicate key value violates unique constraint "terms_pkey"
|
|
2021-01-25 00:02:51.913 IST [61561] DETAIL: Key (id)=(2) already exists.
|
|
2021-01-25 00:02:51.913 IST [61561] STATEMENT: UPDATE "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."terms" SET "id" = '2' WHERE "id" = '9';
|
|
2021-01-25 00:11:59.847 IST [61561] ERROR: null value in column "amount" of relation "fee_assignments" violates not-null constraint
|
|
2021-01-25 00:11:59.847 IST [61561] DETAIL: Failing row contains (1, null, null, null, null, null, null, null, null, null, null, null).
|
|
2021-01-25 00:11:59.847 IST [61561] STATEMENT: INSERT INTO "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."fee_assignments" VALUES (DEFAULT);
|
|
2021-01-25 00:12:14.126 IST [61561] ERROR: insert or update on table "fee_assignments" violates foreign key constraint "fee_assignments_fee_type_id_foreign"
|
|
2021-01-25 00:12:14.126 IST [61561] DETAIL: Key (fee_type_id)=(89) is not present in table "fee_types".
|
|
2021-01-25 00:12:14.126 IST [61561] STATEMENT: INSERT INTO "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."fee_assignments" ("id", "amount", "amount_new_admission", "fee_type_id", "academic_year_id", "term_id", "feeable_type", "feeable_id", "created_at") VALUES ('8253', '2340', '0', '89', '56', '5', 'section', '50', '2020-06-23 16:02:59.271264');
|
|
2021-01-25 00:14:27.104 IST [61561] ERROR: insert or update on table "fee_assignments" violates foreign key constraint "fee_assignments_term_id_foreign"
|
|
2021-01-25 00:14:27.104 IST [61561] DETAIL: Key (term_id)=(5) is not present in table "terms".
|
|
2021-01-25 00:14:27.104 IST [61561] STATEMENT: INSERT INTO "tnt_67201e5a-f3b8-48fb-ae8a-f8484ceed5a1"."fee_assignments" ("id", "amount", "amount_new_admission", "fee_type_id", "academic_year_id", "term_id", "feeable_type", "feeable_id", "created_at") VALUES ('8253', '2340', '0', '89', '56', '5', 'section', '50', '2020-06-23 16:02:59.271264');
|
|
2021-04-13 13:56:20.424 IST [39875] LOG: starting PostgreSQL 13.2 on x86_64-apple-darwin20.3.0, compiled by Apple clang version 12.0.0 (clang-1200.0.32.29), 64-bit
|
|
2021-04-13 13:56:20.428 IST [39875] LOG: listening on IPv6 address "::1", port 5432
|
|
2021-04-13 13:56:20.428 IST [39875] LOG: listening on IPv4 address "127.0.0.1", port 5432
|
|
2021-04-13 13:56:20.434 IST [39875] LOG: listening on Unix socket "/tmp/.s.PGSQL.5432"
|
|
2021-04-13 13:56:20.447 IST [39876] LOG: database system was interrupted; last known up at 2021-04-07 21:56:31 IST
|
|
2021-04-13 13:56:20.630 IST [39876] LOG: database system was not properly shut down; automatic recovery in progress
|
|
2021-04-13 13:56:20.634 IST [39876] LOG: redo starts at 0/4A1B5D0
|
|
2021-04-13 13:56:20.634 IST [39876] LOG: invalid record length at 0/4A1B6B8: wanted 24, got 0
|
|
2021-04-13 13:56:20.634 IST [39876] LOG: redo done at 0/4A1B680
|
|
2021-04-13 13:56:20.645 IST [39875] LOG: database system is ready to accept connections
|
|
2021-04-13 13:57:38.422 IST [39997] ERROR: new row for relation "users" violates check constraint "users_blood_group_check"
|
|
2021-04-13 13:57:38.422 IST [39997] DETAIL: Failing row contains (13, Demo Teacher, 1711, null, null, $2y$10$MVlQIOJyYK2gLtDbVP9LNe//4MqnCFwvpNzXvn0c9irwH5ic6gYEK, 1234567890, 123412341239, 1986-10-10, male, null, null, A+, null, t, null, 2021-04-13 08:27:38, 2021-04-13 08:27:38, null).
|
|
2021-04-13 13:57:38.422 IST [39997] STATEMENT: insert into "users" ("username", "name", "phone", "gender", "dob", "blood_group", "aadhar_number", "password", "updated_at", "created_at") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) returning "id"
|