문제

Suppose these are the columns:

 **name**     **course**
   andy          bio         
   brian         math
   andy          chem

How can I count the name "andy" appeared twice?

도움이 되었습니까?

해결책

You could use group by and count by name

Something like:

SELECT name, COUNT(*) FROM my_table GROUP BY name

Here's a SQLFiddle to demonstrate: http://sqlfiddle.com/#!2/966da/1

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top