The following SQL cannot select the result, it did not display any data.
The data are:
66 0 0 20 ICBC //where transactiontypeid = 20
87 0 66 3 BOC //where soldstockid = 66
85 0 66 4 BCC
84 0 66 4 ICBC
soldstockid = 66 = id in first column.
2nd row is alltranid = 0.
3rd column is soldstockid.
4th column is transactiontypeid.
transactiontypeid=20 and soldstockid>0 is wrong but i do not know how to write it to show the above 4 rows of data.
select [id]=t.id, [transactiontypeid]=transactiontypeid, [type]=r.type, [clientid]=t.clientid, [nickname]=c.nickname,
[currency]=t.currency, [ucurrency]=u.currency, [rate], [amount], [countervalue], [trandatetime], [status]
from alltransaction t inner join client c on t.clientid = c.id inner join currency u on t.currency = u.currency
inner join transactiontype r on t.transactiontypeid = r.id
where alltranid = 0 and transactiontypeid=20 and soldstockid>0 and t.clientid = '12' order by [id] asc