mysql SELECT LEFT title 20 FROM books store order consumer WHERE fio И

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
mysql> SELECT LEFT(title,20) FROM books,store,`order`,consumer WHERE fio = 'Игорев Игорь Игоревич'
-> AND consumer_idconsumer = idconsumer AND order_idorder = idorder AND id = books_id;
mysql> SELECT id,LEFT(title,10),LEFT(author,10),order_idorder FROM books LEFT JOIN store
-> ON id = books_id WHERE order_idorder IS NULL;
mysql> SELECT DISTINCT idconsumer,fio FROM consumer INNER JOIN (`order`,store,books)
-> ON (books_id = id AND idorder = order_idorder AND idconsumer = consumer_idconsumer)
-> WHERE title LIKE '%Zend Framework 2%';
mysql> SELECT COUNT(*) FROM world.city c1 WHERE EXISTS (SELECT * FROM world.city c2 WHERE c1.name = c2.name);