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 7045725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:33:55+00:00 2026-05-28T02:33:55+00:00

The following test case describes my problem. CREATE TABLE the_table (id INT, Title CHAR(10));

  • 0

The following test case describes my problem.

CREATE TABLE the_table (id INT, Title CHAR(10));
CREATE VIEW the_view AS SELECT * FROM the_table;
INSERT INTO the_table VALUES (1, 'Hello');

notice that ‘Title’ in capitalized

Now when I try:

SELECT id, title FROM the_table;

Result:
+------+-------+
| id   | title |
+------+-------+
|    1 | Hello |
+------+-------+

(notice how ‘title’ is lowercase in both the query and the result column)

BUT, when i do the same thing on the view:

SELECT id, title FROM the_view;

Result: 
+------+-------+
| id   | Title |
+------+-------+
|    1 | Hello |
+------+-------+

It is the same select clause, but this time the column name for ‘Title’ is Capitalized!

I am trying to reuse a code with a view of the exact same schema, but this messes it up.

I can’t really find any reference whether this is standard MySQL behavior or not, but is there a way around it?

  • 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-28T02:33:56+00:00Added an answer on May 28, 2026 at 2:33 am

    If we query how the view is stored:

    SHOW CREATE VIEW the_view
    

    … we find a result that contains this:

    CREATE ALGORITHM=UNDEFINED DEFINER=`test`@`%` SQL SECURITY DEFINER VIEW `the_view` AS select `the_table`.`id` AS `id`,`the_table`.`Title` AS `Title` from `the_table`
    

    This happens as well if you replace * with a column list: MySQL adds an AS clause with an alias, which effectively hard-codes column names.

    The conclusion is that a view is not a table. You’ll need to create it with the exact case you want to use. Whatever, case is normally irrelevant unless your client language messes things up when case changes (e.g. PHP associative arrays).

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

Sidebar

Related Questions

I have the following test-code: CREATE TABLE #Foo (Foo int) INSERT INTO #Foo SELECT
Consider the following test case: public class Main { static int a = 0;
I have the following test case: DROP SCHEMA IF EXISTS test CASCADE; CREATE SCHEMA
Consider the following test case: #define _GNU_SOURCE #include <stdio.h> #include <stdarg.h> void test(char **outa,
The following test case fails in rhino mocks: [TestFixture] public class EnumeratorTest { [Test]
The following test case passes in .NET 4.0: var fiT = new FileInfo(myhappyfilename); Assert.IsNotNull(fiT);
When my browser renders the following test case, there's a gap below the image.
I've isolated the behaviour into the following test case. I'd be grateful to anyone
I have the following django test case that is giving me errors: class MyTesting(unittest.TestCase):
I have the following test case in eclipse, using JUnit 4 which is refusing

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.