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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:44:28+00:00 2026-06-11T13:44:28+00:00

I’m trying to create view from my query, this way: CREATE VIEW v_test (

  • 0

I’m trying to create view from my query, this way:

CREATE VIEW v_test
(
OS_ID,
OS_IMIE,
KO_SYMBOL,
OS_NAZWISKO,
OS_SYGNATURA_APS,
UP_DATA_WAZNOSCI_SZKOLENIA,
UP_WAZNOSC_SZKOLENIA_DNI,
UP_DATA_SZKOLENIA,
KT_ID,
KT_DZIEDZINA
)
AS
SELECT
a.OS_ID,
a.OS_IMIE,
a.KO_SYMBOL,
a.OS_NAZWISKO,
a.OS_SYGNATURA_APS,
b.UP_DATA_WAZNOSCI_SZKOLENIA,
b.UP_WAZNOSC_SZKOLENIA_DNI,
b.UP_DATA_SZKOLENIA,
b.KT_ID,
b.KT_DZIEDZINA

FROM (SELECT
      v_ra_osoby_uprawnione.OS_ID,
      v_ra_osoby_uprawnione.KO_SYMBOL,
      v_ra_osoby_uprawnione.OS_NAZWISKO,
      v_ra_osoby_uprawnione.OS_IMIE,
      v_ra_osoby_uprawnione.OS_SYGNATURA_APS,
      v_ra_osoby_uprawnione.OS_EMAIL,
      v_ra_osoby_uprawnione.OS_UZYTKOWNIK
      FROM v_ra_osoby_uprawnione AS v_ra_osoby_uprawnione) AS a INNER JOIN (SELECT
      v_ra_uprawnienia.UP_ID,
      v_ra_uprawnienia.OS_ID,
      v_ra_uprawnienia.UP_NR_POSWIADCZENIA,
      v_ra_uprawnienia.UP_DATA_WAZNOSCI_KLAUZULI,
      v_ra_uprawnienia.UP_DATA_WYDANIA_POSWIADCZENIA,
      v_ra_uprawnienia.UP_NR_ZASWIADCZENIA_O_SZKOLENIU,
      v_ra_uprawnienia.UP_DATA_SZKOLENIA,
      v_ra_uprawnienia.UP_DATA_WAZNOSCI_SZKOLENIA,
      v_ra_uprawnienia.UP_DATA_WAZNOSCI_SZKOLENIA - CURDATE() as UP_WAZNOSC_SZKOLENIA_DNI,
      v_ra_uprawnienia.KT_ETYKIETA,
      v_ra_uprawnienia.KT_DZIEDZINA,
      v_ra_uprawnienia.KT_ID,
      v_ra_uprawnienia.SCISLE_TAJNE,
      v_ra_uprawnienia.TAJNE,
      v_ra_uprawnienia.POUFNE,
      v_ra_uprawnienia.ZASTRZEZONE
      FROM v_ra_uprawnienia AS v_ra_uprawnienia) AS b ON b.OS_ID = a.OS_ID

But mysql does not allow to create view, error code is:
SQL Error: View’s SELECT contains a subquery in the FROM clause

I want to aviod creating views for each subquery. Is tihs possible to create single view in this case by rewriting my query to equivalent without subqueries?

  • 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-11T13:44:29+00:00Added an answer on June 11, 2026 at 1:44 pm

    Is tihs possible to create single view in this case by rewriting my query to equivalent without subqueries?

    Yes:

    CREATE VIEW v_test AS
    SELECT a.OS_ID,
           a.OS_IMIE,
           a.KO_SYMBOL,
           a.OS_NAZWISKO,
           a.OS_SYGNATURA_APS,
           b.UP_DATA_WAZNOSCI_SZKOLENIA,
           b.UP_DATA_WAZNOSCI_SZKOLENIA - CURDATE() AS UP_WAZNOSC_SZKOLENIA_DNI,
           b.UP_DATA_SZKOLENIA,
           b.KT_ID,
           b.KT_DZIEDZINA
    FROM   v_ra_osoby_uprawnione a JOIN v_ra_uprawnienia b USING (OS_ID)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to create an if statement in PHP that prevents a single post
I have a view passing on information from a database: def serve_article(request, id): served_article
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i

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.