
Write SQL Query
- or -
Post a project like this1785
£33/hr(approx. $44/hr)
- Posted:
- Proposals: 17
- Remote
- #3152693
- Awarded
WordPress Expert✮Shopify Expert✮Graphic Designer✮AutoCAD 2D & 3D✮CV Writer & Designer✮Fullstack developer

Python, OpenAI, ChatGPT |Microsoft Fabric| Synapse| SQL Server, Snowflake ❄️, Postgres, MySQL| Power BI, Tableau, Domo | Azure, AWS, GCP| SSIS, Alteryx |AirFlow|AirByte|DBT| DevOps
Top rated PHP Web Development | WordPress | Magento | Drupal | OpenCart | PrestaShop | Joomla

WordPress Expert | Web & App Developer | SEO Specialist | Content Writer | Blockchain | Python | OpenAI | Machine Learning

53299175117625363657351184711451750468770932504275042326105075440667814546113151005
Description
Experience Level: Expert
Hi everyone
We have a single MySQL Database Table called "visits"
id (INT)
memberid (varchar) Member ID
branchuuid(varchar) Branch ID
arrival (bigint) UNIX TIMESTAMP
departure (bigint) UNIX TIMESTAMP
duration (int) Seconds
I want to run a select query on a Member to identify the branches they have visited, their arrival and departure times during the last 2 weeks where they stayed for at least 15 minutes (900 seconds).
Then using this list of Branches and Arrival / Departure Times I want to run another Select Query based on who else was at these branches and stayed at least 15 minutes (900 seconds) at the same time as the First Member.
For example
Branch 1
First Member Arrived at 1pm on Monday
First Member Departed at 2pm on Monday
Search is based on a Member that visited Branch 1 between 3pm and 4pm on Monday does not count. Main Member wasn't there.
Search is based on a Member that visited Branch 1 between 1:50pm and 2:15pm on Monday does not count. Main Member only matches for 10 minutes not 15 or more
Search is based on a Member that visited Branch 1 between 1:30pm and 2:00pm on Monday does count. Both Member and Main Member were at the same location at the same time for at least 15 minutes.
The query should generate a distinct list of Members who came into contact with the Main Member for at least 15 minutes during this last 2 weeks.
The query just asks for a MEMBERID and generates a list of MEMBERIDs who came into contact with same for at least 15 minutes during the last 2 weeks.
So both SELECT queries are part of a single MAIN QUERY.
Good luck
We have a single MySQL Database Table called "visits"
id (INT)
memberid (varchar) Member ID
branchuuid(varchar) Branch ID
arrival (bigint) UNIX TIMESTAMP
departure (bigint) UNIX TIMESTAMP
duration (int) Seconds
I want to run a select query on a Member to identify the branches they have visited, their arrival and departure times during the last 2 weeks where they stayed for at least 15 minutes (900 seconds).
Then using this list of Branches and Arrival / Departure Times I want to run another Select Query based on who else was at these branches and stayed at least 15 minutes (900 seconds) at the same time as the First Member.
For example
Branch 1
First Member Arrived at 1pm on Monday
First Member Departed at 2pm on Monday
Search is based on a Member that visited Branch 1 between 3pm and 4pm on Monday does not count. Main Member wasn't there.
Search is based on a Member that visited Branch 1 between 1:50pm and 2:15pm on Monday does not count. Main Member only matches for 10 minutes not 15 or more
Search is based on a Member that visited Branch 1 between 1:30pm and 2:00pm on Monday does count. Both Member and Main Member were at the same location at the same time for at least 15 minutes.
The query should generate a distinct list of Members who came into contact with the Main Member for at least 15 minutes during this last 2 weeks.
The query just asks for a MEMBERID and generates a list of MEMBERIDs who came into contact with same for at least 15 minutes during the last 2 weeks.
So both SELECT queries are part of a single MAIN QUERY.
Good luck
Mark H.
100% (6)Projects Completed
5
Freelancers worked with
6
Projects awarded
29%
Last project
4 Feb 2021
United Kingdom
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-

Do you have to do only via a query or are you open for another solution? Please let us know.
-

Hi, Mark is query written by any freelancer or you still looking then i submit my proposal
969124969110
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies