To get previous month data in redshift

From following amazon redshift query I am getting current month data, Can anyone please help me how to get previous month data (because interval ‘1 month’ is not working with column name). SELECT count(fact_subscription.subscription_entry_cnt), to_char(dim_date.calendar_date,’mon-yy’ ) as calendar_date FROM bill.fact_subscription INNER JOIN common.dim_date ON fact_subscription.effective_local_date_key=dim_date.date_key WHERE fact_subscription.subscription_entry_cnt=1 AND to_char(dim_date.calendar_date,’mon-yyyy’) = ‘dec-2019’ GROUP BY dim_date.calendar_date

Details

What is the right way to write regular expression in C++?

Having hard time writing below regex expression in C++ (?=[a-zA-Z])*(?=[\s])?(00|\+)[\s]?[0-9]+[\s]?[0-9]+(?=[\sa-zA-Z])* Example string: “ABC + 91 9997474545 DEF” Matched string must be: “+ 91 9997474545” C++ code : #include <iostream> #include <regex> using namespace std; int main() { string a = “ABC + 91 9997474545 DEF”; try { regex b(“(?=[a-zA-Z])*(?=[\\s])?(00|\\+)[\\s]?[0-9]+[\\s]?[0-9]+(?=[\\sa-zA-Z])*”); smatch amatch; if ( regex_search(a, amatch,…

Details

find data by column name using gethibernatetemplate from table

public List<Donatenow> getdonationdetails(String username) { System.out.println(“aaaaa”+username); List<Donatenow> dnm=getHibernateTemplate().find(“from Donatenow where Mobile=?”,username); System.out.println(“spot”+dnm); return dnm; } output: aaaaa9876543210 spot[] ———— here, query don’t execute when i do this code. if i use String “9876543210” instead of username then it’s work.

Details