2013-08-06 3 views
0

마지막으로 본 요소 10 개를 표시하고 싶습니다. 내가 UNION 교리에서 지원되지 않는 것을 알고교리의 UNION 순서 2

SELECT compte.dateConsultation AS dateObjet, societe.nom FROM compte, societe WHERE compte.idSociete = societe.id 

UNION 

SELECT opportunite.dateConsultation as dateObjet, opportunite.nom 
FROM opportunite 

UNION 

SELECT contact.dateConsultation as dateObjet, CONCAT(CONCAT(personne.nom, " "),personne.prenom) 
FROM contact, personne 
WHERE contact.idPersonne = personne.id 

UNION 

SELECT piste.dateConsultation as dateObjet, CONCAT(CONCAT(personne.nom, " "),personne.prenom) 
FROM piste, personne 
WHERE piste.idPersonne = personne.id 

UNION 

SELECT tache.dateConsultation as dateObjet, tache.objet 
FROM tache 

UNION 

SELECT evenement.dateConsultation as dateObjet, evenement.objet 
FROM evenement 

ORDER BY dateObjet DESC 

:

여기에 SQL 내 쿼리입니다. 하지만 모든 요소를 ​​선택하고 주문을 수행해야합니다 날짜 결과에 대한 컨설팅.

답변

0

SELECT * FROM (Your query here -- without the order by) ORDER BY dateObjet DESC