I am trying to add the id numbers of my points to the attribute table of my lines.
I used this post [https://gis.stackexchange.com/a/355320], which solves the problem. However, the resultant layer has way more line features than the original file. The attribute table consists of all possible combinations of starting and ending ids, e.g., N1-N1, N1-N2, N1-N3,…N1, Nk, N2-N1,….). In Image 2 below, you can see the generated attribute table. 
I tried to delete duplicated features using MMQGIS and Grass v.clean tools, but QGIS crashed every time.
Is there another way to delete these duplicates?
Would it be possible to add additional query lines to this query that deletes duplicates at the end? If yes, would you share any examples? I am quite new to SQL queries.
start_point(l.geometry)andend_point(l.geometry)tost_startpoint(l.geometry)andst_endpoint(l.geometry)?