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

  • SEARCH
  • Home
  • 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 8442491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:51:25+00:00 2026-06-10T08:51:25+00:00

I had problem while executing this SQL statement in MySQL workbench. Can anyone point

  • 0

I had problem while executing this SQL statement in MySQL workbench. Can anyone point out the problem for me?

SELECT concat(LocationName,' - ', StationName) AS LocationStation, EmpName AS '0000-0100', EmpName AS '0100-0200', EmpName AS '0200-0300', EmpName AS '0300-0400', EmpName AS '0400-0500', EmpName AS '0500-0600', EmpName AS '0600-0700', EmpName AS '0700-0800', EmpName AS '0800-0900', EmpName AS '0900-1000', EmpName AS '1000-1100', EmpName AS '1100-1200', FROM satsschema.employeeslot
WHERE LocationName = 'T2 PML'
and AllocationDate = '10-Aug' 
and (EmpTime >= '00:00:00' and EmpTime <= '12:00:00')

The above statemnt prompted me this error, “You have an error in your SQL syntax, check the manual that corresponds to your MySQL server version for the right syntax to use neat ‘FROM satsschema.employeeslot WHERE LocationName = ‘T2 PML’ and AllocationDate = ‘ at line 1.”

Secondly, Is there any other ways that could make this line shorter besides typing everything out?

EmpName AS '0000-0100', EmpName AS '0100-0200', EmpName AS '0200-0300', EmpName AS '0300-0400', EmpName AS '0400-0500', EmpName AS '0500-0600', EmpName AS '0600-0700', EmpName AS '0700-0800', EmpName AS '0800-0900', EmpName AS '0900-1000', EmpName AS '1000-1100', EmpName AS '1100-1200', FROM satsschema.employeeslot

Help will be greatly appreciated.

  • 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-06-10T08:51:27+00:00Added an answer on June 10, 2026 at 8:51 am

    Remove the comma before FROM. It causes the error.

    SELECT concat(LocationName,' - ', StationName) AS LocationStation, EmpName AS '0000-0100', EmpName AS '0100-0200', EmpName AS '0200-0300', EmpName AS '0300-0400', EmpName AS '0400-0500', EmpName AS '0500-0600', EmpName AS '0600-0700', EmpName AS '0700-0800', EmpName AS '0800-0900', EmpName AS '0900-1000', EmpName AS '1000-1100', EmpName AS '1100-1200' FROM satsschema.employeeslot
    WHERE LocationName = 'T2 PML'
    and AllocationDate = '10-Aug' 
    and (EmpTime >= '00:00:00' and EmpTime <= '12:00:00')
    

    Note that the error message said exactly where was the error.

    In MySQL, the AS keyword is optional for column aliasing, so you may write EmpName '0000-0100' in place of EmpName AS '0000-0100'. I don’t think there is a short solution to give more than one alias to one column as it’s really not something that is often necessary.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I had this weird problem a little while ago and haven't been able to
I had this problem before and can't for life of me remember how to
I have had the following problem for a while and I am really not
While developing an application, I had the following problem. I wanted to return an
Ok, So I can't seem to figure out how on earth this works. The
I had problems while "archiving" my app. I think there are invalid profiles because
Had a problem with the recursive conflictCheck() method. That seems fine now. I have
I had a Problem to use DotNet 4.0 DLL in a DotNet 2.0 Application,
i had a problem on confusing how to put ontouch inside my coding because
I had a problem with some JavaScript functions that had me scratching my head

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.