Advertisement
Sorok7

Untitled

Mar 6th, 2014
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 1.01 KB | None | 0 0
  1. mysql> CREATE TEMPORARY TABLE IF NOT EXISTS x_t AS
  2.     ->     SELECT
  3.     ->         t.*
  4.     ->     FROM
  5.     ->         `dfi_leads_log_cache` t
  6.     ->     WHERE t.WebsiteId IN ('962', '966', '1008', '1070')
  7.     ->     ORDER BY t.SentDate DESC
  8.     ->     LIMIT 10000;
  9. Query OK, 2953 rows affected, 1 warning (0.84 sec)
  10. Records: 2953  Duplicates: 0  Warnings: 1
  11.  
  12. mysql> SELECT
  13.     ->     IFNULL(tt.`CustFullName`, "(Unknown)") AS `Name`,
  14.     ->     IF(tt.`LeadType` = 1, tt.Campaign, "") AS Campaign
  15.     -> FROM
  16.     ->     x_t tt limit 10;
  17. +------------------+-----------+
  18. | Name             | Campaign  |
  19. +------------------+-----------+
  20. | Yiqzsgmw         | NULL      |
  21. | Marquita Davis   | (not set) |
  22. | Bxjulmfd         | NULL      |
  23. | vincent bond     | (not set) |
  24. | joe KONKOL       | (not set) |
  25. | joe konkol       | (not set) |
  26. | April Johnson    | (not set) |
  27. | Jeffrey Bonamici | (not set) |
  28. | Cherl Nelson     | NULL      |
  29. | Cheryl Nelson    | NULL      |
  30. +------------------+-----------+
  31. 10 rows in set (0.00 sec)
  32.  
  33. mysql>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement