I've got a report that I have grouped by a particular ID, which means some information is necessarily duplicated. In this case, each reference number has multiple patent records associated with it. So if there are 4 patents, it would correctly return 4 rows, but the reference ID, submission date, and title would be repeated on all 4 rows, while the other columns display unique information.
Is it possible to have this return blanks on rows 2-4 so that I only see the "common" information once?
This is what I currently see.
Reference-1 July 1, 2019 Title here Acme, Inc. ABCD-1234 Patent 1
Reference-1 July 1, 2019 Title here Acme, Inc. ABCD-1234 Patent 2
Reference-1 July 1, 2019 Title here Acme, Inc. ABCD-1234 Patent 3
Reference-1 July 1, 2019 Title here Acme, Inc. ABCD-1234 Patent 4
Is it possible to have it return this? I want the same rows returned, just without the duplicated values.
Reference-1 July 1, 2019 Title here Acme, Inc. ABCD-1234 Patent 1
Patent 2
Patent 3
Patent 4
Here's the current version of my code:
SELECT
i.reference_id AS "Reference Number",
i.submission_dt AS "Submission Date",
i.title AS "Title",
o.name AS "Sponsor",
o.grant_number AS "Grant Number",
p.patent_id AS "IP Reference"
FROM
invention i
LEFT OUTER JOIN
organization2invention o2i ON o2i.invention_id = i.invention_id
LEFT OUTER JOIN
organization o ON o2i.organization_id = o.organization_id
LEFT OUTER JOIN
patent2invention pt2i ON pt2i.invention_id = i.invention_id
LEFT OUTER JOIN
patent p ON pt2i.patent_id = p.patent_id
WHERE
o.grant_number = "ABCD-1234"
group by p.patent_id
order by i.reference_id
ETA: In this example, the title would never change between Patent 3 and Patent 4. All of the columns except for the Patent column are linked and would remain the same.
However it IS possible for there to be another set of records with Reference-2, and I would want all of the fields to show the first time Reference-2 appears, but no other time.
Reference-1 July 1, 2019 Title here Acme, Inc. ABCD-1234 Patent 1
Patent 2
Patent 3
Patent 4
Reference-2 July 1, 2019 Title here Acme, Inc. ABCD-1234 Patent 5
Patent 6
Patent 7
Patent 8
version 5.7.22
ETA2: I'm pulling data out of a web/cloud based database with a really shitty UI. They built in a page that has an input box for MySQL code and a button that says "Run Query" for instances their interface doesn't provide data the way we need it. I only have read-only access, and their display doesn't recognize certain things (like \n
), and it has some built in formatting tags (similar to my_object_id AS "My Object|display_name:MyObject"
).
When I click "Run Query" the bottom portion of the web page returns the display.
This functionality is intended to be used as "Custom Reports", so display matters. They just didn't give me a method to do that other than in direct MySQL code.