A
A
Alena2014-09-20 15:02:42
MySQL
Alena, 2014-09-20 15:02:42

How to scatter values ​​in a column in MySql?

select distinct a.object_id as number/*'Номер заявки'*/,
 a.value_text as 'Описание проблемы', 
a.value_date as 'Начало', a.value_date as 'Конец'
from dynamic_field_value as a

I have a dynamic_field_value table. In which the number of the application and the date of the beginning of the application are indicated, the next line indicates the same application number, but the date of its completion. The problem is that I have no idea how to sort - "Display all orders that have only a start date or both dates"

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2014-09-20
@Kossmmooss

The organization is certainly not so hot. It would be easier to immediately add a second end date field.
And so, if, when changing the status, another line is written with a common identifier object_id. Then do COUNT('object_id') as count GROUP BY object and all results where it is greater than 1 will be ignored.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question