Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5945467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:41:08+00:00 2026-05-22T16:41:08+00:00

I have an sql query like this, its giving a syntax error but I

  • 0

I have an sql query like this, its giving a syntax error but I couldn’t find what it was:

CREATE VIEW 
    vw_hs_hr_wf_main_data AS 
        select mo.wfmod_id, 
            mo.wfmod_name, 
            mo.wfmod_view_name, 
            ty.wftype_code,
            ty.wftype_description, 
            ty.wftype_table_name, 
            ty.wftype_view_name,
            ma.wfmain_id, 
            ma.wfmain_sequence,
            CASE
                WHEN ap.wf_main_app_employee IS NULL
                    THEN ma.wfmain_approving_emp_number
                ELSE ap.wf_main_app_employee
            END  CASE AS wfmain_approving_emp_number,
            ma.wfmain_flow_id,
            ty.wftype_update_field, 
            ty.wftype_assembly,
            ty.wftype_assembly_class, 
            ma.wfmain_previous_id,
            ty.wftype_cancelmain_field, 
            ma.wfmain_application_date,
            ty.wftype_cancelstatus_field, 
            ty.wftype_appmain_field,
            ty.wftype_bulk_app_flg, 
            ty.wftype_sort_field_name
        FROM hs_hr_wf_module mo INNER JOIN hs_hr_wf_type ty
            ON mo.wfmod_id = ty.wfmod_id
        INNER JOIN hs_hr_wf_main ma 
            ON ty.wftype_code = ma.wftype_code
        LEFT JOIN hs_hr_wf_main_app_person ap
            ON ma.wfmain_id = ap.wfmain_id
                AND ma.wfmain_sequence = ap.wfmain_sequence
        WHERE (ma.wfmain_iscomplete_flg = 0);

The error message:

#1064 – You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘CASE AS wfmain_approving_emp_number, ma.wfmain_flow_id, ty.wftype_update_fiel’ at line 11

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T16:41:09+00:00Added an answer on May 22, 2026 at 4:41 pm

    You don’t need END CASE to close the CASE, just END:

    END AS wfmain_approving_emp_number,
    

    A better choice in your case would be a COALESCE call:

    COALESCE(ap.wf_main_app_employee, ma.wfmain_approving_emp_number)
    AS wfmain_approving_emp_number
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this SQL query but its running soo slow, SELECT wr.wr_re_id as ReID,
Right now, I have a SQL Query like this one: SELECT X, Y FROM
I have built a T-SQL query like this: DECLARE @search nvarchar(1000) = 'FORMSOF(INFLECTIONAL,hills) AND
I have a SQL query in my ASP.net web app that looks like this:
I have a MySQL query like this: SELECT *, SUM(...some SQL removed for brevety)
I have a mysql table like this (sql): CREATE TABLE IF NOT EXISTS silver_and_pgm
I have a Query that looks something like this (I know its vulnerable to
I have created a query that looks like this but I havent found a
I have a SQL SELECT query which has a LIKE clause containing an underscore,
In T-SQL you could have a query like: SELECT * FROM Users WHERE User_Rights

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.