Category: MeyeSql

Nested Select MySql Statements

Hello, today I want to talk about MySQL. This discussion requires some understanding of MySQL. Let’s discuss the optimization of NESTED SELECT statements. Consider this MySQL statement: SELECT name, (SELECT count(carts.product_id) FROM carts WHERE carts.product_id = products.id AND cart.date=’2015-01-01’) as count FROM products; I have a table for orders and carts and I want to find how many…

Read More