![]() ![]() Or by custid and orderid: select distinct If you only want the custid and the true/false value, then you can add distinct to the query. Select custid, orderid, count(distinct orderComponent) Total If you want to expand this out, to see if the custid has ordered all items in a single order, then you can use: select t1.custid, Having count(distinct orderComponent) = 4 ![]() ![]() Where orderComponent in ('pizza', 'wings', 'breadsticks', 'salad') Select custid, count(distinct orderComponent) Total That is, the "working set", hence buffer_pool size can be less.If you are just looking to see if the customer has ordered all items, then you can use: select t1.custid, Because of the awfullness of uuids, the partitioning may help avoid a lot of the I/O - This is because all of this month's inserts will be going into one partition.(Let me know if you need help.) Saving space -> shrinks table -> cuts back on I/O. Id varchar(36), -guid, primary key - Pack it into BINARY(16). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |