Dwi Hyuga

Dwi Hyuga

  • NA
  • 116
  • 21.7k

please check my query!!

Jan 21 2016 3:02 AM
this is my query, but there was an error 'unknown column 'two' in 'field list'
 
this is my query, please check it for me!!
i need your help
 
SELECT a.*, b.*, c.*, ((a.fl/10)*3.15*c.BeratJenis) AS one, pow(((a.od/10)+1.5)/2,2) AS two, pow((a.id/10)/2,2) AS three, (two-three) AS four, ((one*four)/1000) AS equals FROM tbl_sticker AS a LEFT JOIN tbl_daftar_item AS b ON a.KodeItem=b.KodeItem LEFT JOIN tbl_rho AS c ON a.KodeItem=c.KodeItem WHERE a.IDSticker='1234/18.12101-15';
but when i tried it like this it run normally
 
SELECT a.*, b.*, c.*, ((a.fl/10)*3.15*c.BeratJenis) AS one, pow(((a.od/10)+1.5)/2,2) AS two, pow((a.id/10)/2,2) AS three FROM tbl_sticker AS a LEFT JOIN tbl_daftar_item AS b ON a.KodeItem=b.KodeItem LEFT JOIN tbl_rho AS c ON a.KodeItem=c.KodeItem WHERE a.IDSticker='1234/18.12101-15';

ouughhh ! it so confusing!!
 

Answers (3)