N
N
NubasLol2019-06-05 12:17:11
PostgreSQL
NubasLol, 2019-06-05 12:17:11

How to split one row in a table into several?

For example, there is an entry in the
database table work_times
id: 1
date: 08/20/2020
time_start: 14:00
time_end: 18:00
And in the order table
orders
date: 08/20/2020
time_start: 16:00
time_end: 17:00
I need to do a query that will return
date: 08/20/2020
time_start: 14:00
time_end: 16:00
date: 08/20/2020
time_start: 17:00
time_end: 18:00

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
korus, 2019-06-10
@korus

I didn’t quite understand the question, but if you mean to display data from both tables (without join), then you can use UNION (SELECT x, y, z FROM table1 UNION SELECT x1, y1, z1 FROM table2). Then you can set up ORDER from above.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question