SQL statement, result from different row -


i have sales table this

receipt saletype qtysold sellprice discount 31103  -----     --------- 1 -------   39 ------- 0 31103  ----   w   -------- 1 --------    0 ------- 14 31103  -----     --------- 1 -------   39 ------- 0 31103  ----  w   -------- 1 --------    0 ------- 14 

the actual qtysold 2 pcs receipt 31103.

i trying result qtysold salestype='i' result incorrect when this

select qtysold, sellprice, discount salestable receipt = '31103' 

you can return rows salestype = 'i' including filter in clause. include multiple filters in single clause, need 'and' keyword. code this-

select qtysold, sellprice, discount salestable receipt = '31103' , salestype = 'i' 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -