COUNT (MySQL): verschil tussen versies
Naar navigatie springen
Naar zoeken springen
Regel 6: | Regel 6: | ||
</pre> | </pre> | ||
− | Ander voorbeeld, inclusief <code>group by</code>: | + | Ander voorbeeld, inclusief <code>group by</code> (ik weet niet of dat is ivm. <code>distinct</code> of <code>count()</code>: |
<pre> | <pre> | ||
select | select | ||
− | + | distinct brand, | |
count(brand) as brand_count | count(brand) as brand_count | ||
Versie van 27 nov 2019 19:24
Bijvoorbeeld:
select sum(order_total),count(*) from example.uc_orders
Ander voorbeeld, inclusief group by
(ik weet niet of dat is ivm. distinct
of count()
:
select distinct brand, count(brand) as brand_count from device_tmp group by brand order by brand_count desc;