V
V
Viktor2016-09-27 22:24:49
Yii
Viktor, 2016-09-27 22:24:49

Sql how to compare strings?

Hello Dear SQL gurus
Such a question, there is a table of loans (loans), it is necessary to implement such an opportunity so that the person who issued a loan to someone could not take a loan from the same person to whom he issued another loan (it’s really difficult for me to formulate this) .
You can issue loans as much as you like and take as much as you like, on the screen, I wanted to show that id 4 could not stand up in those fields where id 1 has already taken a loan from me. I just need a check. If it is not possible to solve this in pure Sql, then you can please tell me in yii2.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
romy4, 2016-09-27
@romy4

At least here you need to give an example of tables of people and loans, and their relationships. Then let's continue

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question