Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I got up to chapter 12, but on step 2 there seems to be some error in the preamble, I always get:

    Error: Query failed: SelectSQL: queryAll: near "With": syntax error
Even if my query is a trivial

    select * from crew
(Which is obviously not a correct solution, but should be valid SQL)


Thanks for this! Hmm might be something odd coming in with the way I'm smushing together the steps using with.

Could you share what you wrote for step 1? I thought I had a fix in place for anything ending in ; but there could be other things that are causing errors when put into with


I lost the contents because I closed the window since then, but it was something like

    select staff_name, pod_group, weight_kg
    from crew
    where status != "deceased";
Interestingly, running this now gives me a different error on step 2, which definitely did not happen before:

    Error: Query failed: SelectSQL: queryAll: near ";": syntax error
My step 2 is:

    select
      staff_name,
      pod_group,
      case
        when weight_kg > 10 then weight_kg
        else weight_kg * 10
      end as fixed_weight
    from filtered_crew


Erk, the most frustrating of bugs - an inconsistent one! I think you're hitting errors because in the background I'm adding the queried together in "with" statements and "with" can't have a ; at the end inside the brackets... but the thing is I came across that issue in testing and now I automatically strip out any trailing ; when I pro ess...

Just tested it, even added a bunch of spaces and line breaks at the end to see if that was confusing things but I still seemed to get through ok.

I want to fix this but for now could you try the steps without putting a semicolon at the end? Hopefully your patience/enthusiasm hasn't totally worn out at this point but even if you don't feel like reporting back I'm keen for you to be able to get past the frustration if you're still interested! :-)


No, it's alright!

Yeah, it works if I omit the semicolon.

Hmmm, now that I think about it, I don't think I deleted the pre-filled comment when writing my original query, could it be that I thus fooled your semicolon eraser? Something like

    select * from crew;
    /* blablabla */
HN has a reply chain limit, so if you want further help you can email "hn at myusername period com".




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: