S
S
shokw0w2017-09-28 12:26:30
MySQL
shokw0w, 2017-09-28 12:26:30

How to combine 3 or more tables in a cross query?

Hello. I have a base of four tables:
59ccbf0c4d633519553340.png
I'm trying to do a cross-query where I need to put two rows in the computed area
59ccbfcab855b184989630.png
. So far I'm getting only one row in the calculated area:

TRANSFORM Min(dbo_absents.[absent]) AS [Min-absent]
SELECT dbo_students.[studentname], Sum(dbo_absents.[absent]) AS [tolat absent]
FROM dbo_absents WHERE dbo_absents.[gradeid]=1
GROUP BY dbo_students.[ studentname]
PIVOT dbo_days.[day];

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artyom Karetnikov, 2017-09-28
@art_karetnikov

It is +ms sql with a high degree of probability. It should be placed in the right place, more people will view it. This time.
A student should not have two statuses at once, these are two. The database structure is incorrect. It is necessary to change it to the correct one, if the student has a late time in the field, any value, then he is a latecomer. If there is no value, Null - he did a great job, he was in the classroom.
Got an idea? One field. If the value in this field is greater than the class time, he missed it. If less, but there is - he was late. If there is no value at all - everything is ok.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question