I need help splitting up a POSTGRESQL sales table into hourly format
- or -
Post a project like this3724
$$
- Posted:
- Proposals: 0
- Remote
- #407090
- Completed
Description
Experience Level: Intermediate
Estimated project duration: less than 1 week
General information for the business: Small Business Custom Software Development
Database management system (DBMS): PostgreSQL
Description of requirements/functionality: I need help splitting up a POSTGRESQL table into hourly format.
Following is the schema of source table :
CREATE TABLE sales
(
type_of_order text,
table_no integer,
items text,
seasoning text,
order_in text,
order_out text,
duration text,
served_by text,
quantity text,
price text,
sub_total text,
total double precision,
date_of_order date,
comments text,
comments_kitchen text,
payment_method text,
card_no text,
customer text,
customer_address text,
email_id text,
voucher text,
voucher_amount double precision,
discount double precision,
reason_for_discount text,
invoice text,
receipt text,
order_no text NOT NULL,
status text,
staff_comments text,
amount_paid double precision,
auto_discount double precision,
promotion text,
cust_loyalty_discount double precision,
cust_loyalty_promotion_id text,
drawer_id text,
CONSTRAINT pk_order_no PRIMARY KEY (order_no)
)
I need to extract the data from a given date range and insert it into a new table with hourly format for hourly report. The destination table structure is as given below:
CREATE TABLE sales_statistics
(
items text,
date_of_order date,
hour8 double precision,
hour9 double precision,
hour10 double precision,
hour11 double precision,
hour12 double precision,
hour13 double precision,
hour14 double precision,
hour15 double precision,
hour16 double precision,
hour17 double precision,
hour18 double precision,
hour19 double precision,
hour20 double precision,
hour21 double precision,
hour22 double precision,
hour23 double precision,
hour1 double precision,
hour2 double precision,
hour3 double precision,
hour4 double precision,
hour5 double precision,
hour6 double precision,
hour7 double precision,
hour24 double precision,
quantity text
)
I can do this via for loop in my front end application vb.net but performance is very slow and takes ages to extract the information.
Extra notes:
Database management system (DBMS): PostgreSQL
Description of requirements/functionality: I need help splitting up a POSTGRESQL table into hourly format.
Following is the schema of source table :
CREATE TABLE sales
(
type_of_order text,
table_no integer,
items text,
seasoning text,
order_in text,
order_out text,
duration text,
served_by text,
quantity text,
price text,
sub_total text,
total double precision,
date_of_order date,
comments text,
comments_kitchen text,
payment_method text,
card_no text,
customer text,
customer_address text,
email_id text,
voucher text,
voucher_amount double precision,
discount double precision,
reason_for_discount text,
invoice text,
receipt text,
order_no text NOT NULL,
status text,
staff_comments text,
amount_paid double precision,
auto_discount double precision,
promotion text,
cust_loyalty_discount double precision,
cust_loyalty_promotion_id text,
drawer_id text,
CONSTRAINT pk_order_no PRIMARY KEY (order_no)
)
I need to extract the data from a given date range and insert it into a new table with hourly format for hourly report. The destination table structure is as given below:
CREATE TABLE sales_statistics
(
items text,
date_of_order date,
hour8 double precision,
hour9 double precision,
hour10 double precision,
hour11 double precision,
hour12 double precision,
hour13 double precision,
hour14 double precision,
hour15 double precision,
hour16 double precision,
hour17 double precision,
hour18 double precision,
hour19 double precision,
hour20 double precision,
hour21 double precision,
hour22 double precision,
hour23 double precision,
hour1 double precision,
hour2 double precision,
hour3 double precision,
hour4 double precision,
hour5 double precision,
hour6 double precision,
hour7 double precision,
hour24 double precision,
quantity text
)
I can do this via for loop in my front end application vb.net but performance is very slow and takes ages to extract the information.
Extra notes:
Birender S.
100% (27)Projects Completed
22
Freelancers worked with
20
Projects awarded
39%
Last project
10 Oct 2016
Australia
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies