Reputation: 11
SELECT `p2`, COUNT(*) FROM dsf_2022_raw_new WHERE `p2` LIKE 'BA'
p2 COUNT(*)
BA 608
I was able to get count from that table but I need to get "BA" from 4 more tables with similar structure.
Then what if I want to select BA, DL, TS, AL these are actually first two characters of the post code.
Upvotes: 0
Views: 50
Reputation: 13
welcome to Stack Overflow. So, looks like you're asking two questions there.
SELECT count(*), p2 from <your_view> group by p2
SELECT p2, COUNT(*) FROM dsf_2022_raw_new
WHERE p2 LIKE 'BA'
OR WHERE p2 LIKE 'DL'...
Hope this helps. Happy coding
Upvotes: 1