Home > database >  The SQL statement
The SQL statement

Time:11-24

Trouble bosses to help parse SQL statements, thank brother '

CodePudding user response:

The SELECT stu_nam, CONCAT (stu_no, '_', id), sex, score
FROM the class cl
INNER JOIN student_1 st1 ON cl. Stu_no=st1. Number
The UNION
The SELECT stu_nam, CONCAT (stu_no, '-', id), sex, score
FROM the class cl
INNER JOIN student_2 st2 ON cl. Stu_no=st2. Number;

CodePudding user response:

reference 1st floor qq_45948983 response:
SELECT stu_nam, CONCAT (stu_no, '_', id), sex, score
FROM the class cl
INNER JOIN student_1 st1 ON cl. Stu_no=st1. Number
The UNION
The SELECT stu_nam, CONCAT (stu_no, '-', id), sex, score
FROM the class cl
INNER JOIN student_2 st2 ON cl. Stu_no=st2. Number;

INSERT INTO class (stu_name stu_no, class)
VALUES (' Wang Junru ', '101', 'high 1 classes');

CodePudding user response:

reference 1st floor qq_45948983 response:
SELECT stu_nam, CONCAT (stu_no, '_', id), sex, score
FROM the class cl
INNER JOIN student_1 st1 ON cl. Stu_no=st1. Number
The UNION
The SELECT stu_nam, CONCAT (stu_no, '-', id), sex, score
FROM the class cl
INNER JOIN student_2 st2 ON cl. Stu_no=st2. Number;

Yes, this is 1 of 2 kinds of resolution

CodePudding user response:

refer to the second floor qq_45948983 response:
Quote: refer to 1st floor qq_45948983 response:
SELECT stu_nam, CONCAT (stu_no, '_', id), sex, score
FROM the class cl
INNER JOIN student_1 st1 ON cl. Stu_no=st1. Number
The UNION
The SELECT stu_nam, CONCAT (stu_no, '-', id), sex, score
FROM the class cl
INNER JOIN student_2 st2 ON cl. Stu_no=st2. Number;

INSERT INTO class (stu_name stu_no, class)
VALUES (' Wang Junru ', '101', 'high 1 classes');

DELIMITER $
CREATE PROCEDURE tx (IN s_number INT)
The BEGIN
The SELECT class_name, number, sex, score
The FROM student_1
The UNION
The SELECT class_name, number, sex, score
The FROM student_2;
END $

CodePudding user response:

reference qq_47678112 reply: 3/f
Quote: refer to 1st floor qq_45948983 response:
SELECT stu_nam, CONCAT (stu_no, '_', id), sex, score
FROM the class cl
INNER JOIN student_1 st1 ON cl. Stu_no=st1. Number
The UNION
The SELECT stu_nam, CONCAT (stu_no, '-', id), sex, score
FROM the class cl
INNER JOIN student_2 st2 ON cl. Stu_no=st2. Number;

Yes, this is 1 of 2 kinds of analytic?

This is the problem

CodePudding user response:

Bosses, cow force

CodePudding user response:

refer to 6th floor qq_47678112 response:
, cow force

There is no?? I only just learned MySQL I write my own word is such, also can not sure can't

CodePudding user response:

reference 4 floor qq_45948983 response:
Quote: refer to the second floor qq_45948983 response:
Quote: reference 1st floor qq_45948983 response:
SELECT stu_nam, CONCAT (stu_no, '_', id), sex, score
FROM the class cl
INNER JOIN student_1 st1 ON cl. Stu_no=st1. Number
The UNION
The SELECT stu_nam, CONCAT (stu_no, '-', id), sex, score
FROM the class cl
INNER JOIN student_2 st2 ON cl. Stu_no=st2. Number;

INSERT INTO class (stu_name stu_no, class)
VALUES (' Wang Junru ', '101', 'high 1 classes');

DELIMITER $
CREATE PROCEDURE tx (IN s_number INT)
The BEGIN
The SELECT class_name, number, sex, score
The FROM student_1
The UNION
The SELECT class_name, number, sex, score
The FROM student_2;
END $

A where clause to filter conditions, less  I'm sorry
  • Related