Skip to content

Instantly share code, notes, and snippets.

@erikcs
Last active May 10, 2016 20:08
Show Gist options
  • Save erikcs/74978d7dfaf5f4172278316f44000402 to your computer and use it in GitHub Desktop.
Save erikcs/74978d7dfaf5f4172278316f44000402 to your computer and use it in GitHub Desktop.
wrds-sicjoin
>dbGetQuery(wrds, "SELECT * from CIQ.CIQCOMPANYINDUSTRYTREE WHERE companyId=18527")
companyIndustryId companyId subTypeId primaryFlag charTypeId
1 4029005 18527 3000000 1 3
2 4029006 18527 3010000 1 3
3 4029007 18527 3040000 0 3
4 4029008 18527 3041000 0 3
5 4029009 18527 3041500 0 3
6 4029010 18527 3041510 0 3
7 4029011 18527 3041511 0 3
8 12816597 18527 3050000 1 3
9 12816598 18527 3051000 1 3
10 12816599 18527 3051100 1 3
11 12816600 18527 3051110 1 3
12 12816601 18527 3051200 1 3
13 12816602 18527 3051230 1 3
14 12816603 18527 3051400 1 3
15 12816604 18527 3051410 1 3
16 12816605 18527 3052000 0 3
17 12816612 18527 8000000 0 3
18 12816613 18527 8100000 0 3
19 21727158 18527 8130000 0 3
20 21727159 18527 9612017 0 3
21 21727160 18527 8131100 0 3
22 21727161 18527 8131000 0 3
23 21727162 18527 8131200 0 3
24 21727163 18527 8131240 0 3
25 21727164 18527 8131243 0 3
26 21727165 18527 8131245 0 3
27 33916371 18527 3100000 0 3
28 33916372 18527 3110000 0 3
29 33916373 18527 3112100 0 3
30 33916374 18527 9612010 0 3
31 33916375 18527 9612012 0 3
32 33916376 18527 3112455 0 3
33 33916377 18527 3112459 0 3
34 33916378 18527 8110000 0 3
35 33916379 18527 8111000 0 3
36 33916380 18527 3070000 0 3
37 33916381 18527 3072000 0 3
38 92161176 18527 3115600 0 3
39 117921164 18527 3052110 0 3
40 117921165 18527 3052121 0 3
41 117921166 18527 3052122 0 3
42 117921167 18527 3052123 0 3
43 117921168 18527 3052100 0 3
44 117921169 18527 3052120 0 3
> dbGetQuery(wrds, "SELECT * from CIQ.CIQINDUSTRYTOSIC WHERE subTypeId=3000000")
subTypeId SICCode
1 3e+06 3999
SICDescription
1 Industrials 3e+06 3999
> dbGetQuery(wrds, "SELECT * from CIQ.CIQINDUSTRYTOSIC WHERE subTypeId=3010000")
[1] subTypeId SICCode SICDescription
<0 rows> (or 0-length row.names)
> dbGetQuery(wrds, "SELECT * from CIQ.CIQINDUSTRYTOSIC WHERE subTypeId=3050000")
subTypeId SICCode
1 3050000 3264
2 3050000 3629
3 3050000 3694
4 3050000 3699
SICDescription
1 Electrical Equipment
2 Electrical Equipment
3 Electrical Equipment
4 Electrical Equipment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment