Question: I would like to get all tables and their columns in one table.

For example:

```
Table 1 | Column1 | Column2 | Column3 | 

Table 2 | Column1 |

Table 3 | Column1 | Column2 | Column3 | Column4 | Column5

Table 4 | Column1 | Column2 |

Table 5 | Column1 | Column2 | Column3 | Column4 | Column5

Table 6 | Column1 | Column2 | Column3 | Column4 | Column5 | Column6 | Column7

```

EDIT:

Version I'm using: Microsoft SQL Server 2008 R2 (SP1) - 10.50.2550.0 (X64)

Answer: 
Since you're only after counting the number of zeros in the `double` column, the following should help:

```
library(tidyverse)
df %>% 
  group_by(productID) %>% 
  summarise(sum.of.zeros=sum(double==0, na.rm = T))

```

The above sums the instances where `double` equals zero (if it equals zero, it would counted as 1 (`TRUE`) and if not it would be 0 (`FALSE`). The `na.rm = T` is required because the expression `NA==0` would return an `NA`.
With `data.table` you can do:

```
library("data.table")
setDT(df)[, sum(na.omit(double)==0), productID]

```

or

```
setDT(df)[, sum(double==0, na.rm=TRUE), productID]

```