|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
SQL Total Statement
Hi everybody,
Can anyone provide the sql statement if i just want the total result. I got a field, value, with datatype 1 or 0, so i need to extract the total of how many 1 inside the value. Pls assist to provide the sql statement. Thanks a lot |
|
#3
|
|||
|
|||
|
Sorry, I don't mean the sum of the field. I mean the total record of the field.
Like the field, value, got five 1 and two 0, and after the sql statement to select 0, the answer should be 2 |
|
#4
|
||||
|
||||
|
select count(*) from yourtable where yourcol=0
|
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > SQL Total Statement |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|