Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Database design -请看我的编辑。 select max(NoOfWords), Score from table where NoOfWords <= UserNumberOfWords select field1, field2, field3,rawsco_Database Design_Db2 - Fatal编程技术网

Database design -请看我的编辑。 select max(NoOfWords), Score from table where NoOfWords <= UserNumberOfWords select field1, field2, field3,rawsco

Database design -请看我的编辑。 select max(NoOfWords), Score from table where NoOfWords <= UserNumberOfWords select field1, field2, field3,rawsco,database-design,db2,Database Design,Db2,-请看我的编辑。 select max(NoOfWords), Score from table where NoOfWords <= UserNumberOfWords select field1, field2, field3,rawscore, ( select max(percentage) from scorelookup where words < r.rawscore ) rank from scores r; select field1, field

-请看我的编辑。
 select max(NoOfWords), Score from table
 where NoOfWords <= UserNumberOfWords
select field1, field2, field3,rawscore, (
    select max(percentage) from scorelookup where words < r.rawscore  ) rank
from scores r;
select field1, field2, field3,raw, (
    select max(percentage) from scorelookup where scoreable < r.rawscore and quiz='Test2'  ) rank
from scores r;
CREATE TABLE gameScoreThresholds (
game_id INTEGER NOT NULL,
raw_score SMALLINT NOT NULL,
score_percentage SMALLINT NOT NULL
)
;

CREATE UNIQUE INDEX gamescoreidx ON gameScoreThresholds(game_id, raw_score) CLUSTER
;

ALTER TABLE gameScoreThresholds ADD PRIMARY KEY (game_id, raw_score)
;

SELECT score_percentage FROM gameScoreThresholds 
WHERE game_id = ? AND raw_score <= ?
ORDER BY raw_score DESC 
FETCH FIRST ROW ONLY
;