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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:42:46+00:00 2026-05-25T16:42:46+00:00

For a table I can do like this: ALTER TABLE table_name ADD column_name datatype

  • 0

For a table I can do like this:

ALTER TABLE table_name  
ADD column_name datatype

but this does not apply to an existing view. I wonder if there is a way to solve this?

  • 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-25T16:42:47+00:00Added an answer on May 25, 2026 at 4:42 pm

    Use the Alter View statement to edit a view. Simply use the existing SQL Statement in the current view, and add the column to the end.

    http://dev.mysql.com/doc/refman/5.0/en/alter-view.html

    More detailed explanation than the actual docs can be found here:

    http://www.roseindia.net/mysql/mysql5/views.shtml

    Edit – added

    A view can only display data from an existing table. You would have to add the column to the table and then modify the view to show it as well.

    Think of it this way: A view is just a way of looking at existing data in tables. Tables are holders of real data.

    The only exception to the pattern above that I can think of is that you can have a column on a view that is filled with the results of a calculation such as addition or string contention. For example, consider a table with EmployeeId, FirstName and LastName columns…

    You could have a view that looks like this:

    Create View FullNames AS
    Select EmployeeId, firstname + ' ' + lastname AS FullName from Employees
    

    In that case, I’m sort of adding a column that doesn’t exist in a table – FullName. It’s a computed value based on table data. However, it’s still based on data stored in teh DB somewhere.

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

Sidebar

Related Questions

I have tried adding a foreign key like this... ALTER TABLE OrderLineItem ADD CONSTRAINT
I have a table like this: Application,Program,UsedObject It can have data like this: A,P1,ZZ
i have a table like this: Table(MissioneID, Type) Type can be 1,2 or 3
I'm loading a table like this: mydata <- read.table(c:\\file.tab, header=TRUE, sep=\t, quote=\) I can
I can't quite wrap my head around this one... A table like the one
I would like to add custom attributes to a MySQL table which I can
what is wrong with this alter table command : ALTER TABLE `lp` ADD COLUMN
This is the constraint I have on the Customers table. ALTER TABLE Customers ADD
I got this code, I would like to optimize. I basically can add new
Can I create a Hive table from a sql/text file like we do in

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.