Question: ```
create procedure usbinsertbookDatainto
   @Bookno Numeric,
   @studentno Numeric,
   @currentnoofcopiesavaillable varchar(300),
   @Issuedate datetime,
   @Duedate  datetime
AS
 BEGIN
  Insert into tbluseraccount
        (
          Bookno,
          studentno,
          currentnoofcopiesavaillable,
          Issuedate,
          Duedate
         )
         values
          (
           @Bookno,
           @studentno,
           @currentnoofcopiesavillable,
           @Issuedate,
           @Duedate
            )          
END

```

The error I get is:

> 
> Msg 156, Level 15, State 1, Procedure
>  usbinsertbookDatainto, Line 8  
> 
>  Incorrect syntax near the keyword
>  'AS'.  
> 
>  Msg 137, Level 15, State 2,
>  Procedure usbinsertbookDatainto, Line
>  22  
> 
>  Must declare the scalar variable
>  "@currentnoofcopiesavillable".
> 
> 
>

Answer: 
```
select user_id 
from tableName
group by user_id 
having count(*)  = 1;

```
```
SELECT user_id 
FROM table
GROUP BY user_id
HAVING (COUNT(user_id)=1)

```