Answer the question
In order to leave comments, you need to log in
How to build a SQL query to get the status of work stages in one line?
There is a table with three columns, the following form:
The productid field contains the serial number of the product, the stage field contains the current stage of work, the last field contains the status of the stage of work.
I need to get the following string in the output: 56300 + + - - -
or at least like this: 56300 ready ready in the process is planned null
How to build a SQL query to get such a result?
Answer the question
In order to leave comments, you need to log in
SELECT productid, group_concat(IFNULL(status, 'NULL') SEPARATOR '---') FROM table group by productid;
It is possible to do so. But you can't do that.
State your task, not how you did it.
An analogy to your question:
I want to break my leg and then walk like this, how to do it?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question