Answer the question
In order to leave comments, you need to log in
Functionality, then layout, or vice versa?
It was decided to add new functionality to the site in the form of a blog.
Those. a general page is created where a list of articles will be displayed, as well as a page for the article itself. Accordingly, you need 2 templates, for the general and for the article.
The question is, how to do it right:
1. First, let the layout designer make up everything from layouts in html + css and then give this code to the programmer along with the functional specification?
2. Or first, let the programmer create functional pages without caring about the design, and only then, when the functionality is tested, give him html + css to pull the layout?
Answer the question
In order to leave comments, you need to log in
SELECT t1.date,
t2.income,
t3.outcome
FROM
(
SELECT date
FROM payments
UNION
SELECT date
FROM cash
) AS t1
LEFT JOIN
(
SELECT date,
SUM(income) AS income
FROM payments
GROUP BY date
) AS t2
ON t1.date=t2.date
LEFT JOIN
(
SELECT date,
SUM(summa) AS outcome
FROM payments
GROUP BY date
) AS t3
ON t1.date=t3.date
And the columns income and outcome - why?
Something like this:
select date
, sum( case when ppcc.dt = 1 then ppcc.sum else 0 end )
, sum( case when ppcc.dt = 0 then ppcc.sum else 0 end )
from (
select
pp.date as date
, 1 as dt
, pp.sum as sum
from payments pp
union all
select
pp.date as date
, 0 as dt
, pp.sum as sum
from cash cc
) ppcc
group by ppcc.date
select
date,
sum(dbt),
sum(crd)
from(
select date, summa as dbt, 0 as crd from t1
union all
select date, 0 as dbt, summa as crd from t2
) as t3
group by date
Option 1.
It is easier for a layout designer to create a clean html code than to understand the code of a backend developer later. Not to mention the presence of complex branches, which will add confusion and may lead to the omission of some branches.
3 option. You write TK, which clearly describes what should be. You give it to the coder and proger. They start working together, one typesets, the other prepares the functionality. After the layout is ready, the programmer easily and naturally pulls it on his functional
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question