This topic is locked
[SOLVED]

how to order this report

12/15/2022 12:35:21 PM
PHPRunner General questions
francesco author

Hi all, I have difficult to order by numero this report:

img alt

SELECT
descrizione,
sottogruppo,
numero,
versione,
particolare,
revisione,
partnumber,
fase,
materiale,
quantità,
reparto,
p.id_codice,
i.macchina as macchina
from codice p
join macchina i
where (find_in_set(i.ID,p.doveusato) > 0)
order by numero

What is the correct way to proceed?
thank you

francesco author 12/15/2022

sorry i paste again the query in a readable way

SELECT
descrizione,
sottogruppo,
numero,
versione,
particolare,
revisione,
partnumber,
fase,
materiale,
quantità,
reparto,
p.id_codice,
i.macchina as `macchina`
from `codice` p
join `macchina` i
where (find_in_set(i.`ID`,p.`doveusato`) > 0)
order by numero
Alexey 12/16/2022

Francesco,

It should work as expected, ordered by numero.
Just in case, remove table aliases from your SQL query, they might confuse the SQL parser in PHPRunner:

SELECT
descrizione,
sottogruppo,
numero,
versione,
particolare,
revisione,
partnumber,
fase,
materiale,
quantità,
reparto,
`codice`.id_codice,
`macchina`.macchina as `macchina`
from `codice`
join `macchina`
where (find_in_set(`macchina`.`ID`,`codice`.`doveusato`) > 0)
order by numero

If it doesn't help, contact support directly, we'll need to take a look at your project to resolve this.

francesco author 12/16/2022

Alexey thanks for reply, but it doesn't work

admin 12/17/2022

You know what to do, right?

francesco author 12/18/2022

no i didn't solve and i don't know why

admin 12/19/2022

I guess you didn't have a chance to read the whole message from Alexey:

If it doesn't help, contact support directly, we'll need to take a look at your project to resolve this.

admin 12/19/2022

I guess you didn't have a chance to read the whole message from Alexey:

If it doesn't help, contact support directly, we'll need to take a look at your project to resolve this.

francesco author 1/4/2023

support solved my problem, correct query is:

SELECT
descrizione,
sottogruppo,
numero,
versione,
particolare,
revisione,
partnumber,
fase,
materiale,
quantità,
reparto,
`codice`.id_codice,
`macchina`.macchina as `macchina`
from codice, macchina

where (find_in_set(`macchina`.`ID`,`codice`.`doveusato`) > 0)
order by numero