SQL queryFT2
SQL queryFT2
SELECT count(*) as count from m_bank where is_delete = false and (name ilike
'Bank Anteng' OR va_code='3014');
SELECT count(*) as count from m_bank where is_delete = false and (name ilike 'Bank
Anteng');
SELECT count(*) as count from m_bank where is_delete = false and (va_code='3014');
SELECT COUNT(*) as count FROM m_bank WHERE is_delete = false and(name = 'Bank
Anteng' OR va_code = '3014')AND id != 2;
SELECT COUNT(*) as count FROM m_bank WHERE is_delete = false and((name ilike 'Bank
Anteng')AND id != 41);
/----------------------------------------------------------------------------------
------/
/----------------------------/
/-----------------------------/
/-------------------------------------------------------/
create table m_customer_relation(
id bigint primary key generated always as identity not null,
name varchar(50),
created_by bigint not null,
created_on date not null,
modified_by bigint,
modified_on date,
deleted_by bigint,
deleted_on date,
is_delete boolean default false not null
);
/----------------------------------------------------------/
/-----------------------------------------------------------------/
/------------------------------------------------------------------/
/------------------------------------------------------------------------/
/-----------------------------------------------------------------------/
/------------------------------------------------------------------------/
select c.*,b.fullname,cr."name",extract (year from now()) - extract (year from
c.dob) as umur
from m_customer c
join m_biodata b
on c.biodata_id = b.id
join m_customer_member cm
on cm.customer_id = c.id
join m_customer_relation cr
on cr.id = cm.customer_relation_id
join m_user u
on u.id = cm.parent_biodata_id
order by c.id;
select extract (year from now()) - extract (year from dob) as umur from m_customer;
select mc.id, mb.fullname, extract (year from now()) - extract (year from mc.dob)
as umur, mc.gender, mbg.code, mc.rhesus_type, mc.height, mc.weight, mcr.name
from m_biodata mb
join m_customer mc
on mb.id = mc.biodata_id
join m_blood_group mbg
on mbg.id = mc.blood_group_id
join m_customer_member mcm
on mcm.customer_id = mc.id
join m_customer_relation mcr
on mcr.id = mcm.customer_relation_id
WHERE mc.is_delete = false;
/----------------------------------------------------------------------------------
--------------------/
/----------------------------------------------SPRINT 2----BUAT
JANJI------------------------------------------------/
/----------------------------FASKES--------------------------------/
/-----------------------------------------
Date---------------------------------------------/
/-------/