Forum Stats

  • 3,781,305 Users
  • 2,254,499 Discussions
  • 7,879,637 Comments

Discussions

To find the latest rate with sum(qty)

arvindarvind24
arvindarvind24 Member Posts: 5
edited Mar 27, 2019 5:22AM in SQL & PL/SQL

Hi All,

  I need help to find the latest rate with sum(qty).

Table Data

Date/Time

ENTTYPE

ICODE

QTY

RATE

AMOUNT

COSTRATE

STOCKCODE

12-07-2018 13:16:01

STI

1078721

1

555

555

306

13,29,63,031

12-08-2018 13:43:43

STO

1078721

-1

555

-555

306

13,30,63,750

12-08-2018 13:43:44

GRC

1078721

1

555

555

306

13,30,63,751

12-07-2018 13:15:25

STI

1286216

1

396

396

171

13,29,58,629

12-08-2018 13:44:17

STO

1286216

-1

396

-396

171

13,30,64,148

12-08-2018 13:44:17

GRC

1286216

1

396

396

171

13,30,64,149

12-07-2018 13:15:23

STI

1310463

1

2,682

2,682

1,464

13,29,58,505

12-08-2018 13:45:57

STO

1310463

-1

2,682

-2,682

1,464

13,30,65,099

12-08-2018 13:45:57

GRC

1310463

1

2,682

2,682

1,464

13,30,65,101

12-08-2018 13:57:51

SAL

1310463

-1

1,799

-1,799

1,435

13,30,72,921

12-07-2018 13:15:24

STI

1310471

1

2,011

2,011

1,097

13,29,58,547

12-08-2018 13:45:50

STO

1310471

-1

2,011

-2,011

1,097

13,30,65,005

12-08-2018 13:45:50

GRC

1310471

1

2,011

2,011

1,097

13,30,65,018

12-22-2018 11:13:08

SAL

1310471

-1

1,349

-1,349

1,075

13,45,73,379

12-24-2018 22:44:55

SAL

1310471

1

1,349

1,349

1,075

13,48,45,249

12-26-2018 23:12:50

SAL

1310471

-1

1,349

-1,349

1,075

13,50,50,105

Out Put Requirement

Date/Time

ENTTYPE

ICODE

SUM QTY

RATE

AMOUNT

COSTRATE

STOCKCODE

12-08-2018 13:43:44

GRC

1078721

1

555

555

306

13,30,63,751

12-08-2018 13:44:17

GRC

1286216

1

396

396

171

13,30,64,149

12-08-2018 13:57:51

SAL

1310463

0

1,799

-1,799

1,435

13,30,72,921

12-26-2018 23:12:50

SAL

1310471

0

1,349

-1,349

1,075

13,50,50,105

Tagged:
arvindarvind24Frank Kulash
«1

Answers