Problems from nested SELECT
Posted: Tue Mar 12, 2019 11:59 am
Hi,
I am new in this trade. I am asking for help regarding the command I put here (below). I want to retrieve a list of patents containing the number of publications, claims, cited patents, cited articles and data from tls201_appln (main table), and tls209_appln_ipc (restriction to IPCs)
All the time the message I get is:
[SELECT - 0 row(s), 0 secs] [Error Code: 156, SQL State: S0001] Incorrect syntax near the keyword 'FROM'
I'm sure it is a silly mistake, but as I don't have other training with SQL than just a few days, it is hard to solve. Here is the full sentence:
SELECT tls201_appln.*, 'Publications', 'Claims', 'CitedPatents', 'CitedArts', tls209_appln_ipc.*
(SELECT COUNT(*) AS 'Publications', SUM(tls211_pat_publn.publn_claims) AS 'Claims',
SUM( tls212_citation.cited_pat_publn_id) AS 'CitedPatents', SUM(tls212_citation.cited_npl_publn_id) AS 'CitedArts'
FROM tls211_pat_publn, tls212_citation
JOIN tls211_pat_publn ON tls212_citation.pat_publn_id = tls211_pat_publn.pat_publn_id)
FROM tls201_appln, tls211_pat_publn, tls212_citation, tls209_appln_ipc
JOIN tls209_appln_ipc ON tls201_appln.appln_id = tls209_appln_ipc.appln_id
WHERE(( tls209_appln_ipc.ipc_class_symbol LIKE 'B82Y%'
or tls209_appln_ipc.ipc_class_symbol LIKE 'B81C%'
or tls209_appln_ipc.ipc_class_symbol LIKE 'B82B%') -- NANOTECHNOLOGY
AND tls201_appln.granted= 'Y'
AND tls201_appln.publn_first_grant='Y'
AND tls201_appln.earliest_publn_year= 2002)
GROUP BY tls201_appln.appln_id
ORDER BY tls201_appln.appln_id
Any suggestion is welcome!
Thanks!
Jon
I am new in this trade. I am asking for help regarding the command I put here (below). I want to retrieve a list of patents containing the number of publications, claims, cited patents, cited articles and data from tls201_appln (main table), and tls209_appln_ipc (restriction to IPCs)
All the time the message I get is:
[SELECT - 0 row(s), 0 secs] [Error Code: 156, SQL State: S0001] Incorrect syntax near the keyword 'FROM'
I'm sure it is a silly mistake, but as I don't have other training with SQL than just a few days, it is hard to solve. Here is the full sentence:
SELECT tls201_appln.*, 'Publications', 'Claims', 'CitedPatents', 'CitedArts', tls209_appln_ipc.*
(SELECT COUNT(*) AS 'Publications', SUM(tls211_pat_publn.publn_claims) AS 'Claims',
SUM( tls212_citation.cited_pat_publn_id) AS 'CitedPatents', SUM(tls212_citation.cited_npl_publn_id) AS 'CitedArts'
FROM tls211_pat_publn, tls212_citation
JOIN tls211_pat_publn ON tls212_citation.pat_publn_id = tls211_pat_publn.pat_publn_id)
FROM tls201_appln, tls211_pat_publn, tls212_citation, tls209_appln_ipc
JOIN tls209_appln_ipc ON tls201_appln.appln_id = tls209_appln_ipc.appln_id
WHERE(( tls209_appln_ipc.ipc_class_symbol LIKE 'B82Y%'
or tls209_appln_ipc.ipc_class_symbol LIKE 'B81C%'
or tls209_appln_ipc.ipc_class_symbol LIKE 'B82B%') -- NANOTECHNOLOGY
AND tls201_appln.granted= 'Y'
AND tls201_appln.publn_first_grant='Y'
AND tls201_appln.earliest_publn_year= 2002)
GROUP BY tls201_appln.appln_id
ORDER BY tls201_appln.appln_id
Any suggestion is welcome!
Thanks!
Jon