-
Notifications
You must be signed in to change notification settings - Fork 0
/
sqlHeidi.sql
41 lines (31 loc) · 1.13 KB
/
sqlHeidi.sql
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
SELECT ta_stock.id, symbol, company, exchange, stockID, close, date
FROM ta_stockprice JOIN ta_stock ON ta_stockprice.stockID = ta_stock.id
GROUP BY ta_stock.id
HAVING COUNT(*) > 50 AND stockID = 8648
ORDER by DATE DESC
SELECT ta_stock.id, symbol, company, exchange, stockID, MIN(close), date
FROM ta_stockprice JOIN ta_stock ON ta_stock.id = ta_stockprice.stockID
GROUP BY ta_stock.id
HAVING COUNT(*) > 50
ORDER by DATE DESC
SELECT * FROM (
SELECT ta_stock.id, symbol, company, exchange, stockID, MIN(close), date
FROM ta_stockprice JOIN ta_stock ON ta_stock.id = ta_stockprice.stockID
GROUP BY ta_stock.id
HAVING COUNT(*) > 50
ORDER by DATE DESC
) sub WHERE DATE > "2021-06-30"
SELECT * FROM ta_stockprice
WHERE stockid = 8648
ORDER BY close DESC
SELECT stockID, DATE, close, symbol
FROM ta_stockprice JOIN ta_stock ON ta_stock.id = ta_stockprice.stockID
WHERE stockid = 8648
ORDER BY close DESC
SELECT * FROM ta_stock
ORDER BY symbol
SELECT stockID, symbol, COUNT(*)
FROM ta_stockprice JOIN ta_stock ON ta_stock.id = ta_stockprice.stockID
GROUP BY stockID
HAVING COUNT(*) > 50
ORDER BY COUNT(*) ASC, symbol ASC