i am doing something wrong here and that is why my...
# sql
s
i am doing something wrong here and that is why my sql statements even its executing but it looks to me its proving me wrong results, i am concerned about how i wrote the sql for the cfloop anyone can verify and guide link to the fiddle https://www.db-fiddle.com/f/4Rqahz5vHtZpyPcEsMKPzW/0
p
Those 2 queries don't look like they're trying to achieve the same thing so it's hard to tell what you're trying to do. Can you give an example of what results you are getting, and what you're expecting? Also, if you're selecting from a list, you don't need the loop to do a query for each item in the list, you can use
IN
for the WHERE clause to do a single query https://www.db-fiddle.com/f/bD7ewLx6MyHjxwFU1vhKGq/0
s
i am getting NULL in datatabase query when i run it, correct you said, i can use in, but this loop is actually creating a column for each date, and when it runs in the loop, it outputs right results so trying to understand what i did wrong in sql query i wrote