![]() ![]() Show all records starting with the letters 'bob' AND the phone number '3444444'. Mysql> SELECT * FROM WHERE name != "Bob" AND phone_number = '3444444' order by phone_number Show all records not containing the name "Bob" AND the phone number '3444444' order by the phone_number field. ![]() Mysql> SELECT * FROM WHERE name = "Bob" AND phone_number = '3444444' Show all records containing the name "Bob" AND the phone number '3444444'. Show certain selected rows with the value "whatever". Returns the columns and column information pertaining to the designated table. SELECT DISTINCT COUNT(DISTINCT `orders`.`id`) FROM `orders` INNER JOIN `order_products` ON `order_products`.`order_id` = `orders`.`id` WHERE (orders.magstar_id IS NOT null AND orders.magstar_submitted_at IS NOT null) AND (order_type IS NOT null AND orders.order_type != 'C') AND `orders`.`deleted` = 0 AND (orders.magstar_id NOT LIKE '%F%') AND (submitted_at >= ' 00:00:00.000000') AND (orders.magstar_id NOT LIKE '%F%') AND (order_product_quantities_count >= 12) AND (order_product_quantities_count > order_products_count) AND (order_products.quantity >= 12) SELECT `orders`.* FROM `orders` WHERE (orders.magstar_id IS NOT null AND orders.magstar_submitted_at IS NOT null) AND (order_type IS NOT null AND orders.order_type != 'C') AND `orders`.`deleted` = 0 AND (orders.magstar_id NOT LIKE '%F%') AND (submitted_at between ' 00:00:00' and ' 23:59:59') AND (total_cost >= 900.00) SELECT products.id, products.magstar_id FROM products ORDER BY id ASC LIMIT 20 SELECT * FROM orders INNER JOIN order_products ON order_products.order_id = orders.id WHERE order_products.product_id = 16227 Order.includes(:order_products).where("order_products.product_id = 16227").references(:order_products) $alberta_makeever: mysql -u root -p user_development exit ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |