i have a litte problem with my sql-query:
I have a old database (more than 30 Years old) with a table (test):
TABLE: *test*
ID SNR DATE
---------------------------
1 1 1911-11-11
2 1 1911-11-11
3 1 2019-04-17
4 2 1911-11-11
5 2 1911-11-11
6 2 1911-11-11
7 3 1911-11-11
8 3 1911-11-11
9 3 2017-01-20
10 4 1911-11-11
11 4 1911-11-11
12 4 1911-11-11
et cetera
Each record with the same SNR are related
for example:
ID 1,2,3 are Related AND ID 4,5,6 are Related
I need the records where the Date is only 1911-11-11
for example:
SNR: 2 AND 4
my query:
SELECT * FROM test GROUP BY SNR AND DATE != 1911-11-11 ORDER BY ID
Is it possible to do this with a mysql query?
I hope you can help me
best regards
SELECT * FROM test WHERE 'DATE' != "1911-11-11" GROUP BY SNR ORDER BY ID- hereDATEis quoted because it is a reserved wordDATEyou should use backticks not single quotes...SELECT * FROM test WHERE `DATE` != "1911-11-11" GROUP BY SNR ORDER BY ID