qsqlquery - two sql query mix for one -
I want to add two pieces in one code, but I get an error:
1
SELECT idstd, namestd, idmajor, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15 Kernel by tbcheked) as the idmd command (SELECT 1) variant (by idstd), idstd, namestd, idmd, idstd, namestd, idmd, source pivot (max (status) For Col IN (C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15) ) PIV this code is if Column Location in currently , absent or then leave the values of , . Example:
id | C1 | C2 | C3 | C4 | C5 | I have another piece of code for counting the status: SELECT idstd, namemajor, SUM (case when status = ' Present 'now 1 ELSE 0 ADD) Currently, SM (case when the situation =' absentee 'then 1 ELSE 0 AD) absent, leaving the SM (case when the situation =' leave 'then 1 ELSE 0 ADD), TBKCAD Output from the idstd, namemajor ORDER idstd from the group: Output:
id | Current | Absent | Skip 1 3 1 1 Now, I want to get involved in both questions:
id | C1 | C2 | C3 | C4 | C5 | Current | Absent | Skip Present present attendees present to present the present 3 1 1
Please inquire
one at .id = b.id (Query 2) from B (Query 1) One *, B. Select.
Comments
Post a Comment