Jump to content

How to retrieve information from orders with SQL


Recommended Posts



I would like to retrieve some information that are shown in the backend order page.


I would like to write SQL queries that will allow me to get information for several orders at a time, for instance all orders for the last month or the last 6 months.


What I would like to retrieve:


- the number of 1st orders within a certain period (for instance how many orders in the last month were 1st orders for those customers). On each order it shows whether or not it is the client's first order, but I can't find this information in the database.


- the way the client arrived on the page. I have a "Source" menu in each order where I can see how the client arrived on the page (email, google, ...) and if applicable the keywords that he typed. I can't seem to find these information anywhere in the database. Where can I find them?


Thank you very much for your help!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...