Query that works in MYSQL but not SQLite ( Syntax difference? ) -


hi have query selects houses houses table grouped street address. counts how many on street counts how many on street referenced in canvass table.

i have query working in mysql when try sqlite in ios app doesn't work. there syntax differences between 2 unaware of?

 select haddress hd, count( * ) ,     (      select count( * )       canvass, house      canvass.hid = house.hid      , house.haddress = hd     )  house  group haddress 

seems can't reference column aliases in inner queries on sqlite, you'll have change inner query use alias house can reference outer house.haddress. altered query should work on both sqlite , mysql;

select haddress hd, count( * ),     (      select count( * )       canvass, house house2      canvass.hid = house2.hid      , house2.haddress = house.haddress     ) house group haddress 

Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -