I have table in mysql database having below values:
src dst calldate
923 901 2015-09-03
923 923 2015-09-03
923 901 2015-09-03
901 901 2015-09-03
923 901 2015-09-03
923 901 2015-09-03
901 901 2015-09-03
923 901 2015-09-03
901 923 2015-09-03
923 901 2015-09-03
923 901 2015-09-03
923 923 2015-09-03
901 911 2015-09-03
I want to query table so i get counter of same values for both src_count and dst_count. For an example if i count for “923” it should count occurances of 923 in src and dst as below.
MySQL Query:
Select src as number, count(src) as src_count, count(dst) as dst_count from mytable group by src
Result should be:
number src_count dst_count datetime name
923 9 3 2015-09-03 Mr. T1