I need you help in making a query about this table.

------------------------------------

boss # | bet1 | bet2 | bet3

LastName |Bet1 |Bet2 | Bet3
11111111 |1 |0 | 1
22222222 |1 |0 | 0
333333 |0 |1 | 1
44444 |0 |1 | 1

i want to count the "1" in the column bet1, bet2 and bet3.

Posible it will look like this
____________________________
bet1 | bet2 | bet3
____________________________

2 | 2 | 3

Or it will look like this

bet1 | 2
bet2 | 2
bet3 | 3

Thanks.

Try:

SELECT 
    SUM(bet1) as bet1, 
    SUM(bet2) as bet2, 
    SUM(bet3) as bet3
FROM 
    MyTabtle
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.