This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| view: mp_companies { | |
| derived_table: { | |
| sql: | |
| SELECT | |
| distinct_id, | |
| CAST(JSON_EXTRACT_SCALAR(properties, "$.com_id") AS INT64) AS com_id | |
| FROM mp.event | |
| WHERE name = "Signed Up" ;; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT | |
| time, | |
| name, | |
| current_url | |
| FROM ( | |
| SELECT | |
| distinct_id, | |
| CAST(JSON_EXTRACT_SCALAR(properties, "$.com_id") AS INT64) AS com_id | |
| FROM mp.event | |
| WHERE name = "Signed Up" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT | |
| properties, | |
| JSON_EXTRACT_SCALAR(properties, "$.com_id") AS com_id | |
| FROM mp.event | |
| WHERE name = "Signed Up" | |
| LIMIT 1 | |
| +-----------------+--------+ | |
| | properties | com_id | | |
| +-----------------+--------+ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT COUNT(*) FROM mp.event WHERE city = "Tokyo" AND DATE(time) = "2018-04-03" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mixpanel.track("Signed Up", { | |
| com_id: comId | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script> | |
| mixpanel.track("Viewed Page"); | |
| </script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| javascript:(function(){ | |
| var newReferrer = prompt('Set the referrer:'); | |
| Object.defineProperty(document, "referrer", {configurable: true, get : function(){ return newReferrer; }}) | |
| })(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SET @mpy_id = (SELECT MAX(mpy_id) + 1 from members_payments); | |
| DROP TABLE IF EXISTS members_payments_all_ids; | |
| CREATE TEMPORARY TABLE members_payments_all_ids AS ( | |
| SELECT @mpy_id := @mpy_id - 1 AS mpy_id | |
| FROM members_payments mp1, members_payments mp2 | |
| WHERE @mpy_id > 1 | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SET @mpy_id = (SELECT MAX(mpy_id) + 1 from members_payments); | |
| DROP TABLE IF EXISTS members_payments_all_ids; | |
| CREATE TEMPORARY TABLE members_payments_all_ids AS ( | |
| SELECT @mpy_id := @mpy_id - 1 AS mpy_id | |
| FROM members_payments mp1, members_payments mp2 | |
| WHERE @mpy_id > 1 | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT mpy_id FROM members_payments WHERE mpy_id BETWEEN 1 AND 10; | |
| +--------+ | |
| | mpy_id | | |
| +--------+ | |
| | 1 | | |
| | 4 | | |
| | 6 | | |
| | 9 | | |
| | 10 | |