S
S
Sergey Valitov2016-12-24 00:37:38
MySQL
Sergey Valitov, 2016-12-24 00:37:38

How to rewrite MS SQL Server and MySql query?

Hello! There was such a task to rewrite the query from ms sql to mysql database. There is a problem with the request..

SELECT  
top(1) with ties Part_manufacturer,Part_katnum,Part_name 
FROM  
Price 
WHERE  
Part_katnum Like 'MZ6901%'  
order by row_number()over(partition by Part_katnum, Part_manufacturer order by Part_name desc)

It is necessary that the catalog number + manufacturer (it is clear from the fields what is where) are unique in the selection, despite the fact that their names may differ (Part_name). Breaking my head(

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question