Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.25 KB | None | 0 0
  1. -- Total number of active callsigns for individuals
  2. select count(*)
  3. from dbo.pubacc_am am
  4. join dbo.pubacc_hd hd on am.unique_system_identifier = hd.unique_system_identifier
  5. join dbo.pubacc_en en on en.unique_system_identifier = hd.unique_system_identifier
  6. where en.applicant_type_code = 'I' and hd.license_status = 'A'
  7.  
  8. -- Number of active 2X2 vanity callsigns for individuals
  9. -- See query in next section
  10.  
  11. -- Number of active 2X2 non-vanity callsigns for individuals
  12. -- See query in next section
  13.  
  14. -- Number of active 1X2 vanity callsigns for individuals
  15. select count(*)
  16. from dbo.pubacc_am am
  17. join dbo.pubacc_hd hd on am.unique_system_identifier = hd.unique_system_identifier
  18. join dbo.pubacc_en en on en.unique_system_identifier = hd.unique_system_identifier
  19. where en.applicant_type_code = 'I' and hd.license_status = 'A' and am.callsign ~ '^[A-Z]{1}[0-9][A-Z]{2}[ ]*$' and hd.radio_service_code = 'HV';
  20.  
  21. -- Number of active 1X2 non-vanity callsigns for individuals
  22. select count(*)
  23. from dbo.pubacc_am am
  24. join dbo.pubacc_hd hd on am.unique_system_identifier = hd.unique_system_identifier
  25. join dbo.pubacc_en en on en.unique_system_identifier = hd.unique_system_identifier
  26. where en.applicant_type_code = 'I' and hd.license_status = 'A' and am.callsign ~ '^[A-Z]{1}[0-9][A-Z]{2}[ ]*$' and hd.radio_service_code = 'HA';
  27.  
  28. -- Number of active 2X1 vanity callsigns for individuals
  29. select count(*)
  30. from dbo.pubacc_am am
  31. join dbo.pubacc_hd hd on am.unique_system_identifier = hd.unique_system_identifier
  32. join dbo.pubacc_en en on en.unique_system_identifier = hd.unique_system_identifier
  33. where en.applicant_type_code = 'I' and hd.license_status = 'A' and am.callsign ~ '^[A-Z]{2}[0-9][A-Z]{1}[ ]*$' and hd.radio_service_code = 'HV';
  34.  
  35. -- Number of active 2X1 non-vanity callsigns for individuals
  36. select count(*)
  37. from dbo.pubacc_am am
  38. join dbo.pubacc_hd hd on am.unique_system_identifier = hd.unique_system_identifier
  39. join dbo.pubacc_en en on en.unique_system_identifier = hd.unique_system_identifier
  40. where en.applicant_type_code = 'I' and hd.license_status = 'A' and am.callsign ~ '^[A-Z]{2}[0-9][A-Z]{1}[ ]*$' and hd.radio_service_code = 'HA';
  41.  
  42. -- Number of active 2X3 vanity callsigns for individuals
  43. select count(*)
  44. from dbo.pubacc_am am
  45. join dbo.pubacc_hd hd on am.unique_system_identifier = hd.unique_system_identifier
  46. join dbo.pubacc_en en on en.unique_system_identifier = hd.unique_system_identifier
  47. where en.applicant_type_code = 'I' and hd.license_status = 'A' and am.callsign ~ '^[A-Z]{2}[0-9][A-Z]{3}[ ]*$' and hd.radio_service_code = 'HV';
  48.  
  49. -- Number of active 2X3 non-vanity callsigns for individuals
  50. select count(*)
  51. from dbo.pubacc_am am
  52. join dbo.pubacc_hd hd on am.unique_system_identifier = hd.unique_system_identifier
  53. join dbo.pubacc_en en on en.unique_system_identifier = hd.unique_system_identifier
  54. where en.applicant_type_code = 'I' and hd.license_status = 'A' and am.callsign ~ '^[A-Z]{2}[0-9][A-Z]{3}[ ]*$' and hd.radio_service_code = 'HA';
  55.  
  56. -- Number of active 1X3 vanity callsigns for individuals
  57. select count(*)
  58. from dbo.pubacc_am am
  59. join dbo.pubacc_hd hd on am.unique_system_identifier = hd.unique_system_identifier
  60. join dbo.pubacc_en en on en.unique_system_identifier = hd.unique_system_identifier
  61. where en.applicant_type_code = 'I' and hd.license_status = 'A' and am.callsign ~ '^[A-Z]{1}[0-9][A-Z]{3}[ ]*$' and hd.radio_service_code = 'HV';
  62.  
  63. -- Number of active 1X3 non-vanity callsigns for individuals
  64. select count(*)
  65. from dbo.pubacc_am am
  66. join dbo.pubacc_hd hd on am.unique_system_identifier = hd.unique_system_identifier
  67. join dbo.pubacc_en en on en.unique_system_identifier = hd.unique_system_identifier
  68. where en.applicant_type_code = 'I' and hd.license_status = 'A' and am.callsign ~ '^[A-Z]{1}[0-9][A-Z]{3}[ ]*$' and hd.radio_service_code = 'HA';
  69.  
  70. -------------------------------------------------------------------------------------------------------------------------------------------------
  71.  
  72.  
  73. -- Total number of active 2X2 callsigns for individuals
  74. select count(*)
  75. from dbo.pubacc_am am
  76. join dbo.pubacc_hd hd on am.unique_system_identifier = hd.unique_system_identifier
  77. join dbo.pubacc_en en on en.unique_system_identifier = hd.unique_system_identifier
  78. where en.applicant_type_code = 'I' and hd.license_status = 'A' and am.callsign ~ '^[A-Z]{2}[0-9][A-Z]{2}[ ]*$';
  79.  
  80. -- Number of active 2X2 vanity callsigns for individuals
  81. select count(*)
  82. from dbo.pubacc_am am
  83. join dbo.pubacc_hd hd on am.unique_system_identifier = hd.unique_system_identifier
  84. join dbo.pubacc_en en on en.unique_system_identifier = hd.unique_system_identifier
  85. where en.applicant_type_code = 'I' and hd.license_status = 'A' and am.callsign ~ '^[A-Z]{2}[0-9][A-Z]{2}[ ]*$' and hd.radio_service_code = 'HV';
  86.  
  87. -- Number of active 2X2 non-vanity callsigns for individuals
  88. select count(*)
  89. from dbo.pubacc_am am
  90. join dbo.pubacc_hd hd on am.unique_system_identifier = hd.unique_system_identifier
  91. join dbo.pubacc_en en on en.unique_system_identifier = hd.unique_system_identifier
  92. where en.applicant_type_code = 'I' and hd.license_status = 'A' and am.callsign ~ '^[A-Z]{2}[0-9][A-Z]{2}[ ]*$' and hd.radio_service_code = 'HA';
  93.  
  94. -- Number of active 2X2 callsigns for individuals with no previous callsign or operator class
  95. select count(*)
  96. from dbo.pubacc_am am
  97. join dbo.pubacc_hd hd on am.unique_system_identifier = hd.unique_system_identifier
  98. join dbo.pubacc_en en on en.unique_system_identifier = hd.unique_system_identifier
  99. where en.applicant_type_code = 'I' and hd.license_status = 'A' and am.callsign ~ '^[A-Z]{2}[0-9][A-Z]{2}[ ]*$' and am.previous_callsign is null and am.previous_operator_class is null;
  100.  
  101. -- Number of active 2X2 vanity callsigns for individuals with no previous callsign or operator class
  102. select count(*)
  103. from dbo.pubacc_am am
  104. join dbo.pubacc_hd hd on am.unique_system_identifier = hd.unique_system_identifier
  105. join dbo.pubacc_en en on en.unique_system_identifier = hd.unique_system_identifier
  106. where en.applicant_type_code = 'I' and hd.license_status = 'A' and am.callsign ~ '^[A-Z]{2}[0-9][A-Z]{2}[ ]*$' and hd.radio_service_code = 'HV' and am.previous_callsign is null and am.previous_operator_class is null;
  107.  
  108. -- Number of active 2X2 non-vanity callsigns for individuals with no previous callsign or operator class
  109. select count(*)
  110. from dbo.pubacc_am am
  111. join dbo.pubacc_hd hd on am.unique_system_identifier = hd.unique_system_identifier
  112. join dbo.pubacc_en en on en.unique_system_identifier = hd.unique_system_identifier
  113. where en.applicant_type_code = 'I' and hd.license_status = 'A' and am.callsign ~ '^[A-Z]{2}[0-9][A-Z]{2}[ ]*$' and hd.radio_service_code = 'HA' and am.previous_callsign is null and am.previous_operator_class is null;
  114.  
  115. -------------------------------------------------------------------------------------------------------------------------------------------------
  116.  
  117. -- Total Number of active extra or advanced licenses for individuals
  118. select count(*)
  119. from dbo.pubacc_am am
  120. join dbo.pubacc_hd hd on am.unique_system_identifier = hd.unique_system_identifier
  121. join dbo.pubacc_en en on en.unique_system_identifier = hd.unique_system_identifier
  122. where en.applicant_type_code = 'I' and am.operator_class in ('E', 'A') and hd.license_status = 'A';
  123.  
  124. -- Number of active extra or advanced licenses for individuals with vanity callsigns
  125. select count(*)
  126. from dbo.pubacc_am am
  127. join dbo.pubacc_hd hd on am.unique_system_identifier = hd.unique_system_identifier
  128. join dbo.pubacc_en en on en.unique_system_identifier = hd.unique_system_identifier
  129. where en.applicant_type_code = 'I' and am.operator_class in ('E', 'A') and hd.license_status = 'A' and hd.radio_service_code = 'HV';
  130.  
  131. -- Number of active extra or advanced licenses for individuals with non-vanity callsigns
  132. select count(*)
  133. from dbo.pubacc_am am
  134. join dbo.pubacc_hd hd on am.unique_system_identifier = hd.unique_system_identifier
  135. join dbo.pubacc_en en on en.unique_system_identifier = hd.unique_system_identifier
  136. where en.applicant_type_code = 'I' and am.operator_class in ('E', 'A') and hd.license_status = 'A' and hd.radio_service_code = 'HA';
  137.  
  138. -- Number of active extra or advanced licenses for individuals with no previous callsign or operator class
  139. select count(*)
  140. from dbo.pubacc_am am
  141. join dbo.pubacc_hd hd on am.unique_system_identifier = hd.unique_system_identifier
  142. join dbo.pubacc_en en on en.unique_system_identifier = hd.unique_system_identifier
  143. where en.applicant_type_code = 'I' and am.operator_class in ('E', 'A') and hd.license_status = 'A' and am.previous_callsign is null and am.previous_operator_class is null;
  144.  
  145. -- Number of active extra or advanced licenses for individuals with vanity callsigns and no previous callsign or operator class
  146. select count(*)
  147. from dbo.pubacc_am am
  148. join dbo.pubacc_hd hd on am.unique_system_identifier = hd.unique_system_identifier
  149. join dbo.pubacc_en en on en.unique_system_identifier = hd.unique_system_identifier
  150. where en.applicant_type_code = 'I' and am.operator_class in ('E', 'A') and hd.license_status = 'A' and hd.radio_service_code = 'HV' and am.previous_callsign is null and am.previous_operator_class is null;
  151.  
  152. -- Number of active extra or advanced licenses for individuals with non-vanity callsigns and no previous callsign or operator class
  153. select count(*)
  154. from dbo.pubacc_am am
  155. join dbo.pubacc_hd hd on am.unique_system_identifier = hd.unique_system_identifier
  156. join dbo.pubacc_en en on en.unique_system_identifier = hd.unique_system_identifier
  157. where en.applicant_type_code = 'I' and am.operator_class in ('E', 'A') and hd.license_status = 'A' and hd.radio_service_code = 'HA' and am.previous_callsign is null and am.previous_operator_class is null;
  158.  
  159. -- Number of active extra or advanced licenses for individuals with 2X2 callsigns
  160. select count(*)
  161. from dbo.pubacc_am am
  162. join dbo.pubacc_hd hd on am.unique_system_identifier = hd.unique_system_identifier
  163. join dbo.pubacc_en en on en.unique_system_identifier = hd.unique_system_identifier
  164. where en.applicant_type_code = 'I' and am.operator_class in ('E', 'A') and hd.license_status = 'A' and am.callsign ~ '^[A-Z]{2}[0-9][A-Z]{2}[ ]*$';
  165.  
  166. -- Number of active extra or advanced licenses for individuals with vanity 2X2 callsigns
  167. select count(*)
  168. from dbo.pubacc_am am
  169. join dbo.pubacc_hd hd on am.unique_system_identifier = hd.unique_system_identifier
  170. join dbo.pubacc_en en on en.unique_system_identifier = hd.unique_system_identifier
  171. where en.applicant_type_code = 'I' and am.operator_class in ('E', 'A') and hd.license_status = 'A' and hd.radio_service_code = 'HV' and am.callsign ~ '^[A-Z]{2}[0-9][A-Z]{2}[ ]*$';
  172.  
  173. -- Number of active extra or advanced licenses for individuals with non-vanity 2X2 callsigns
  174. select count(*)
  175. from dbo.pubacc_am am
  176. join dbo.pubacc_hd hd on am.unique_system_identifier = hd.unique_system_identifier
  177. join dbo.pubacc_en en on en.unique_system_identifier = hd.unique_system_identifier
  178. where en.applicant_type_code = 'I' and am.operator_class in ('E', 'A') and hd.license_status = 'A' and hd.radio_service_code = 'HA' and am.callsign ~ '^[A-Z]{2}[0-9][A-Z]{2}[ ]*$';
  179.  
  180. -- Number of active extra or advanced licenses for individuals with 2X2 callsigns and no previous callsign or operator class
  181. select count(*)
  182. from dbo.pubacc_am am
  183. join dbo.pubacc_hd hd on am.unique_system_identifier = hd.unique_system_identifier
  184. join dbo.pubacc_en en on en.unique_system_identifier = hd.unique_system_identifier
  185. where en.applicant_type_code = 'I' and am.operator_class in ('E', 'A') and hd.license_status = 'A' and am.callsign ~ '^[A-Z]{2}[0-9][A-Z]{2}[ ]*$' and am.previous_callsign is null and am.previous_operator_class is null;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement