0% found this document useful (0 votes)
27 views

SQL Querry

This SQL query summarizes the total current amount billed for each circuit code from the billprocess and mconsumer tables for the year 2013 and month 03, ordered by circuit code. It also provides the total current amount collected for each substation code from the billprocess, mconsumer and substation tables for the year 2013 and month 02 by reader code 5, ordered by substation code. The second query modifies the first by replacing the '-' with '=' in the join condition of the consumercode fields.

Uploaded by

Bilal Ahmad
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

SQL Querry

This SQL query summarizes the total current amount billed for each circuit code from the billprocess and mconsumer tables for the year 2013 and month 03, ordered by circuit code. It also provides the total current amount collected for each substation code from the billprocess, mconsumer and substation tables for the year 2013 and month 02 by reader code 5, ordered by substation code. The second query modifies the first by replacing the '-' with '=' in the join condition of the consumercode fields.

Uploaded by

Bilal Ahmad
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

select circuitcode,sum(currentamount) from billprocess a, mconsumer b where a.consumercode-b.

consumercode and blyear=2013 and blmonth=03 group by circuitcode order by circuitcode

for revenue billed , replace bilprocess by revcoll and (bl) by r for substation wise, replace circuitcode by substacode select substcode,sum(currentamount) from billprocess a, mconsumer b, substation c where a.substacode=b.substationcode and b.substationcode =c.substationcode and blyear=2013 and blmonth=02 and readercode=5 group by substacode order by substacode IN VERY FIRST COMMAND REPLACE - BY = where a.consumercode=b.consumercode and blyear=2013

You might also like