Closed. This question needs details or clarity . It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post .
Closed 27 days ago.
Improve this question
I would like to find the query that allows me to find when a new customer has an invoice then mark that client as 1 for 'NEW' and then group it by by EOMONTH(date)
The columns I have in the database
Date
Account_Id
Account_Name
Revenue
Final output would look something like this
Date Account Id Account Name Revenue Status
30/06/2023 123 123 Limited £123 1
30/06/2023 1234 1234 Limited £1000 0
Any help would be really appreciated
1条答案
按热度按时间e37o9pze1#
Considered that invoices has separate table follow below query
If invoice is with in the table follow below query
Use
CASE
expression based on your requirements.