Note that there are some explanatory texts on larger screens.

plurals
  1. POcount first time occurrence of foreign keys
    primarykey
    data
    text
    <p>Besides the tags, I would like to solve this on query, if possible. I have this table</p> <pre><code>activity_type | value | date | company_id network.new | 1 | 2011-10-08 | 1 members.count | 3 | 2011-10-08 | 1 network.new | 1 | 2011-10-10 | 2 network.new | 1 | 2011-10-11 | 3 members.count | 4 | 2011-10-11 | 2 </code></pre> <ul> <li>That's basically a log activity. </li> <li>'network.new' activity occur only once per company_id</li> <li>'members_count' activity occur only after 'network.new' appears per company_id and can appear once per day per company_id.</li> </ul> <p>I need to make a line graph that the X axis is the date, the Y axis is the quantity of two things:</p> <ol> <li>How many company_ids have members each day of activity for the <strong>first time</strong> (That is the one that is giving me a hard time);</li> <li>How many have the network.new activity and only that activity for each given day.</li> </ol> <p>All queries I tried gave me false-positive lists, mostly because it counts company_ids that have the 'members_count' activity every day.</p> <p>I wish, if possible, to create a query that give me date, first_time_members, new_company columns for <code>create view</code> purposes. I hope my question was clear enough, and not silly because I couldn't find it anything that looks close to my problem anywhere.</p> <p><strong>[EDIT]</strong></p> <p>Since my english is really poor, I couldn't make myself clear I'm going to try explain a litle more:</p> <blockquote> <p>My client have a network of companies and he wishes to learn how many companies join the network day by day but there's a catch: A company when sign in for the network, it is only considered a completed one when it is also had registered members. So he wants to know, how many companies make a 'incomplete' sign up and how many make a 'complete' sign up.</p> </blockquote> <p>Mr Ollie Jones put me in the right direction, I think I can use what he tough me, but it is not right there yet. Thank ollie Jones for your answer by the way. Answers like yours made me love this site.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload