B_gd_n[ ]Sahlean:...
DESI ... DESI ... DESI ...
ioana:The ORDER BY clause is invalid in views, inline functions, derived
tables, subqueries, and common table expressions, unless
TOP or FOR XML
is also specified....
deci nu pot pune order by in subquery?

SELECT DISTINCT Q.h Q.x, Q.y, Q.z, Q.m, Q.n, Q.q
FROM
(
SELECT TOP 100 PERCENT B.f, B.g, B.h, B.h A.x, A.y, A.z, B.m, B.n, B.q
FROM (B INNER JOIN A ON B.w=A.w)
WHERE A.x = '1'
ORDER BY B.f, B.g, B.h
) AS Q