T
T
timehollyname2021-09-29 15:17:39
Laravel
timehollyname, 2021-09-29 15:17:39

Database, join both columns from different tables?

I have 2 tables, suppose the first one (Has columns: id, message, updated_at, created_at):

table_1 -> id, message, updated_at, created_at

And the second one (Has columns: id, table_1_id, message, updated_at, created_at):

table_2 -> id, table_1_id, message, updated_at, created_at


The first table stores the first part of the message, and the second table stores the second part of the message, and the second table is also linked to the first.

Let's say the first table contains an entry:
id: "1", message: "my-name-is-andrey", updated_at: "00/00/00 00:00:00", created_at: "00/00/00 00:00:00"

And in the second table there is an entry:
id: "1", message: "hi-andrey-!", updated_at: "00/00/00 00:00:00", created_at: "00/00/00 00:00:00"


How do I find an entry in the second table if there is a complete search string: "my-name-is-andrey-hi-andrey-!" ? Is this actually possible to do?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question