“Kelas Rang Mysql 7” Kode Jawaban

Kelas Rang Mysql 7

SELECT    a.first_name,
      a.age,
      a.gender,
        count(b.age)+1 as rank
FROM  person a left join person b on a.age>b.age and a.gender=b.gender 
group by  a.first_name,
      a.age,
      a.gender
Ugly Unicorn

Kelas Rang Mysql 7

Bill    32  M   4
Bob     25  M   2
Jack    30  M   3
Nick    22  M   1
Steve   36  M   5
Anne    25  F   3
Jane    20  F   2
Kathy   18  F   1
Ugly Unicorn

Kelas Rang Mysql 7

CREATE TABLE person (id int, first_name varchar(20), age int, gender char(1));

INSERT INTO person VALUES (1, 'Bob', 25, 'M');
INSERT INTO person VALUES (2, 'Jane', 20, 'F');
INSERT INTO person VALUES (3, 'Jack', 30, 'M');
INSERT INTO person VALUES (4, 'Bill', 32, 'M');
INSERT INTO person VALUES (5, 'Nick', 22, 'M');
INSERT INTO person VALUES (6, 'Kathy', 18, 'F');
INSERT INTO person VALUES (7, 'Steve', 36, 'M');
INSERT INTO person VALUES (8, 'Anne', 25, 'F');
Ugly Unicorn

Jawaban yang mirip dengan “Kelas Rang Mysql 7”

Pertanyaan yang mirip dengan “Kelas Rang Mysql 7”

Lebih banyak jawaban terkait untuk “Kelas Rang Mysql 7” di Sql

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya