Answer the question
In order to leave comments, you need to log in
How to fetch data from table1 or from table2?
Hello!
There were difficulties with data sampling.
Given:
table Orders; (PK: OrderId) - Orders
table Legal entities (PK: FirmID, FK:OrderId) - Firms;
table Individuals (PK:PersonID, FK:OrderID) - Persons;
Jur. Persons
FirmsID;
ordersID;
companyname;
Individual
PersonsID;
ordersID;
FLPName;(client name)
Orders
OrdersID
ContractDate;
comment;
The orders table has a primary key Orders.OrderId which can be used to link legal tables. faces and physical faces. How to merge into one column Jur. individuals and physical persons(customer column)? That is, the result of the request should be one value - the client (legal entity or individual).
Answer the question
In order to leave comments, you need to log in
I can suggest you join everything, and use a function like coalesce in mssql in the list of output columns. you get something like coalesce(jurname,fizname,"') as clientname
include renders the template with the data that it has at a particular point in time, returns a ready-made rendered text. Your block is redefined after the templates are rendered.
Got it, thanks! We'll have to merge everything from "index_*.html" to "index.html".
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question