php - Execute multiple SQL queries and sort the output -


currently, i'm working on project requires me execute 2 sql queries, have sort output date , id before writing output of both queries table.

sorting both queries in sql :

order order.date desc, order.id desc. 

then appending results in 1 variable gets looped on part of script. executing seperate queries result in 2 blocks of sorted items not sorted when appending results.

what solution data sorted properly?

try use

select a.* ((query1) union (query2)) order a.date desc, a.id desc 

Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

serialization - Convert Any type in scala to Array[Byte] and back -

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -