Question: I have a table which has a column in which I am storing a comma separated text with single quotes for each of the comma separated values. These values are employee IDs. This is how it looks

[![enter image description here](https://i.stack.imgur.com/V1qw9.png)](https://i.stack.imgur.com/V1qw9.png)

Now, I have a SQL query wherein I need to put the value from this column into a SQL IN operator. Something like this:

```
select * 
from EMPLOYEE_MASTER 
where EMPLOYEEID IN (select CM_CONFIG_VALUE 
                     from ADL_CONFIG_MAST_T 
                     where CM_CONFIG_KEY like 'ATT_BIOMETRIC_OU_ID'
                    )

```

But this, does not work, the query when executed returns 0 rows whereas if I execute the query normally like below, it works.

```
select * 
from EMPLOYEE_MASTER 
where EMPLOYEEID IN('9F3DD4B791554DDE','C9B90D62851D43AB','828CB9E6204B4DDC')

```

Please suggest what I should do here. I have tried using substring to remove the first and the last character as well assuming that single quotes might be the issue, but that does not work either.

Answer: 
There is no practical difference to the interval itself between any of your three implementations. `setInterval()` does not pay any attention to the return value from the callback so it doesn't matter at all that the `async` version returns a promise.

You can declare it `async` if you want to use `await` inside the callback for your own implementation, but that won't affect the event loop whether you use `await` or `.then()`. With `await`, as soon as you hit the `await` on a promise, the callback will return immediately and the event loop will be able to process other events. The same is true if you do `fn().then()`. While the asynchronous operation is running and the promise is waiting to get notified of completion, the event loop can process other events.

You may also want to know that there's no difference between these two:

```
fn(async()=>{
  fetchFile()
}, 1000)

fn(async()=>{
  await fetchFile()
}, 1000)

```

even outside of the `setInterval()` world. Doing an await on the last line of an `async` function doesn't add anything. It's just superfluous. But, in the `setInterval()` case, since `setInterval()` doesn't pay any attention to the return value from the callback, there's no practical difference between any of your three implementations.

In fact, there's no difference between `return fetchFile()` and `return await fetchFile()` either in an `async` function.

---

In all your examples, you have NO error handling on `fetchFile()`. If it rejects, you will have an unhandled rejection. To catch those errors, you would either surround an `await` with `try/catch` or use `.catch()`.
First of all you pass `async` function callback to `setInterval` function which not expects `async` function in result you lack of proper error handling;

So if you want to run some periodic function I propose something like this, where you have more control on your code with error handling. Keep in mind that this could block event loop as your code could run thru microstask queeue only.

```js
const util = require('util');
const sleep = util.promisify(setTimeout);

const fetchFile = async () => {
  console.log('some async function');
};

async function fetchSomeFile() {
  try {
    await fetchFile();
    sleep(1000);
    fetchSomeFile();
  } catch (err) {
    console.log(err);
  }
}

fetchSomeFile().catch(err => console.log(err));

```

I propose to watch good presentation - Broken Promises - James Snell, NearForm <https://youtu.be/XV-u_Ow47s0>