How can I select those fields/records which are Greater than

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

stephenrodrics
New php-forum User
New php-forum User
Posts: 58
Joined: Thu Mar 14, 2013 6:10 am

How can I select those fields/records which are Greater than

Postby stephenrodrics » Mon Dec 09, 2013 6:35 am

How can I select those fields/records which are Greater than zero

The below query fetch records those records also which are Greater than Zero or Zero, I simply want to avoid zero records

SELECT EMPID, LEGALNAME, SUM( TTK) AS TTK, SUM( MW ) AS MW, SUM( AL ) AS AL

FROM weeklytable

WHERE week

BETWEEN '2013-12-02'

AND '2013-12-06'

GROUP BY EMPID

HAVING (

SUM( TTK ) >0

OR SUM( AL ) >0)

here is the sample data what I am getting

here is the sample data

EMPID EMPNAME TTK MW AL
01 Joe 8 12 0
02 Tom 0 0 8

Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 1 guest