-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquery-talon-lists.sql
More file actions
53 lines (45 loc) · 1.38 KB
/
query-talon-lists.sql
File metadata and controls
53 lines (45 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
-- SQL Server commands to query TalonLists table
-- 1. View all unique list names
SELECT DISTINCT ListName
FROM TalonLists
ORDER BY ListName;
-- 2. Count items per list
SELECT ListName, COUNT(*) as ItemCount
FROM TalonLists
GROUP BY ListName
ORDER BY ListName;
-- 3. View all lists with their spoken forms and values (first 50 items)
SELECT ListName, SpokenForm, ListValue
FROM TalonLists
ORDER BY ListName, SpokenForm
LIMIT 50;
-- 4. Search for specific list (example: git-related lists)
SELECT DISTINCT ListName
FROM TalonLists
WHERE ListName LIKE '%git%'
ORDER BY ListName;
-- 5. View a specific list's contents (example: user.git_argument)
SELECT SpokenForm, ListValue
FROM TalonLists
WHERE ListName = 'user.git_argument'
ORDER BY SpokenForm;
-- 6. Count total lists and total items
SELECT
COUNT(DISTINCT ListName) as TotalLists,
COUNT(*) as TotalItems
FROM TalonLists;
-- 7. Find lists that contain specific spoken forms or values
SELECT DISTINCT ListName
FROM TalonLists
WHERE SpokenForm LIKE '%abort%' OR ListValue LIKE '%abort%'
ORDER BY ListName;
-- 8. View sample of each list (first 3 items per list)
WITH RankedLists AS (
SELECT ListName, SpokenForm, ListValue,
ROW_NUMBER() OVER (PARTITION BY ListName ORDER BY SpokenForm) as rn
FROM TalonLists
)
SELECT ListName, SpokenForm, ListValue
FROM RankedLists
WHERE rn <= 3
ORDER BY ListName, SpokenForm;