我想计算total no of Products
特定购物清单的数量,然后total count of products
根据其在Shopping List table
.I 中的 id 显示该购物清单的。我在产品表中创建了 shopping_list 的引用
我的购物清单如下:-
id serial NOT NULL,
shopping_list_name character varying(255),
shopping_list_status character varying(255) DEFAULT 'OPEN'::character varying,
total_items character varying(255) DEFAULT 0,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
deleted integer NOT NULL DEFAULT 0,
CONSTRAINT shopping_lists_pkey PRIMARY KEY (id)
我的产品表如下:-
id serial NOT NULL,
shopping_list_id integer NOT NULL,
product_name character varying(255) DEFAULT 'null'::character varying,
product_category character varying(255),
quantity integer,
status character varying(255) DEFAULT 'OPEN'::character varying,
deleted integer NOT NULL DEFAULT 0,
CONSTRAINT products_pkey PRIMARY KEY (id)
谁能帮帮我吗:-