Advertisement
cdsatrian

APriori MySQL

Apr 20th, 2017
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.37 KB | None | 0 0
  1. SELECT
  2.     x.id_barang AS barang1,
  3.     y.id_barang AS barang2,
  4.     COUNT(*) AS frekuensi,
  5.     ROUND(COUNT(x.id_barang AND y.id_barang)/(SELECT COUNT(*) FROM tbl_detail_transaksi GROUP BY id_transaksi)*100,1) AS support
  6. FROM
  7.     tbl_detail_transaksi x,
  8.     tbl_detail_transaksi y
  9. WHERE
  10.     x.id_barang<y.id_barang
  11.     AND x.id_transaksi=y.id_transaksi
  12. GROUP BY
  13.     x.id_barang, y.id_barang
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement