Getting most similar rows in MySQL table and order them by similarity
问题 I have a database table that holds user's vehicles (cars, motorcycles). I want to get the most similar vehicles out of that table. Lets say the table holds the following columns (with some context to get the idea): table: vehicles vehicle_id (pk, auto-increment) model_id (BMW 3er, Honda Accord) fuel_type (gasoline, diesel) body_style (sedan, coupe) year engine_size (2.0L) engine_power (150hp) So in short I want to select N (usually 3) rows that have the same make_id (at least) and rank them