doubt VIEW Mysql

Asked

Viewed 39 times

0

In a table I have the following columns: nomeAluno, disciplina, numeroDeFaltas.

I need a VIEW that I can put the student’s name in the clause WHERE and she returns to me the name of the discipline that this student has less fouls, like:

SELECT disciplina
FROM nomeView
WHERE nomeAluno = 'Marcos';
  • 1

    In a VIEW cannot have parameters. For this you have to create a Stored Procedure.

  • See for example https://answall.com/questions/75962/passar-par%C3%a2metro-em-view As João Martins indicated, it is not possible to pass parameters to a view

  • It got a little confused what you need, a VIEW where you put a student in the WHERE and return which discipline he lacks the least. A VIEW is nothing more than a mounted SELECT that will always be used, that is, instead of you always riding complex SELECT from scratch where you can have N tables, you just call your VIEW. From what I understand you want to set up a script (select) where when receiving a student he returns to the discipline with less missing, if it is a simple select it is not even necessary a VIEW. If you need help to mount this SELECT, put here the tables that v

  • 2

    Possible duplicate of Pass parameter in View

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.