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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T16:48:39+00:00 2026-05-29T16:48:39+00:00

I am creating a view with the query shown below: create view v2 as

  • 0

I am creating a view with the query shown below:

create view v2 as
(select * from appearance a
where exists (
    select p.id from photo p, photographer u, person s
    where p.takenBy = u.id
    and u.id = s.id
    and a.isShownIn = p.id
    and s.name = 'Fred'
    )
);

The appearance table has 2 columns ‘shows’ and ‘isShownIn’ but when i try to insert in the view, it gives me error as Error Code: 1054. Unknown column ‘a.isShownIn’ in ‘where clause’

While browsing over this I cam over that I am mistaking over alias, but everything looks OK to me, could anyone please point out where could be the error?

Thanks!

  • 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-29T16:48:58+00:00Added an answer on May 29, 2026 at 4:48 pm

    You will not be able to insert in a view created in that way. Only certain views are updateable. In your specific case, you should just insert into appearance table, since your view is just a selection from that table.

    For limitations for updateable views, check this out. Your view has this problem: “A subquery in the WHERE clause that refers to a table in the FROM clause”

    Like @Umbrella suggested, you can use join instead of exists, and in that way, you would avoid inner query, and you might have updateable view, but I really think that there is no need to insert into that view, because you will have the same effect by just inserting into appearance table.

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

Sidebar

Related Questions

I have quite complicated query from which I would like to create a view.
So I am creating a table from a view right now like this: CREATE
SQL Server doesn't allow creating an view with schema binding where the view query
I have created an indexed view: CREATE VIEW LogValueTexts WITH SCHEMABINDING AS SELECT ISNULL(LRVS_SLOG_ID*256+LRVS_IDX,0)
I have the statement below when creating a Oracle view. The statement is to
I am trying to create an index on the following view: SELECT 'Candidate' AS
Consider this query: SELECT F1,F2 FROM TABLE GROUP BY F1 Selecting F1 is valid,
When creating a view and setting group by value some field, it groups only
Can rails handle creating a view without a controller? For example, let say I
I am creating an SQL view for a file that strips out the spaces

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.