i have 1 simple table 'drugs' 4 columns: 'ean', 'atc', 'amount', 'price'. eans , atcs kind of drugs codes, while amount number of drug packages have been bought given price. non of them unique, rows can (and do) duplicate. need cost of single package, used:
select ean, atc, round((price/amount),2) drugs
but result has fewer rows. precise, drugs has 23,658,687 total rows, while query result has 23,657,443. happened 1,244 records? thought result have same rows, new computed values in each row instead of old two.
add
select ean, atc, round((price/amount),2) drugs 1=1
and select records. have no idea why works does. i'm guessing there exact duplicate records weren't getting returned , new statement forces them appear.
Comments
Post a Comment