jokedst / CsvQuery

Plugin for Notepad++ that treats CSV files as (read only) SQL tables
153 stars 28 forks source link

feature request: do query on more than one Notepad++ tab. #37

Closed Luuk34 closed 1 year ago

Luuk34 commented 1 year ago

Suppose I have two opened CSV files, on tabs New 1 and New 2.

It would be great when a query like this could work:

SELECT *
FROM "New 1" as n1
LEFT JOIN "New 2" as n2 on n2.i = n1.i

(provided, of course, that columns i do exist in both CSV's)

Things I can think of that needs attention: 1) The tablename THIS should be rename to that name of the current tab. 2) Care should be taken when the name of the tab changes (save as...) 3) ...... ?

jokedst commented 1 year ago

You can do this already! The tables are called "T1", "T2" etc. To see what tables exists, you can type "SELECT * FROM sqlite_master". This query is available in the plugin menu, "Plugins" -> "CsvQuery" -> "List parsed files"

jokedst commented 1 year ago

You need an "ON" in there. i.e. "SELECT * FROM T1 LEFT JOIN T2 ON T1.FROM = T2.FFL"

On Sun, 30 Oct 2022 at 23:48, teotwawki @.***> wrote:

It seems that I was able to do table joins on prior versions, but joining T1 and T2 I now receive an error. Upon running SELECT * FROM T1 LEFT JOIN T1.FROM = T2.FFL I receive the following error. CSV Query Error Could not execute query: near "FROM": syntax error OK

— Reply to this email directly, view it on GitHub https://github.com/jokedst/CsvQuery/issues/37#issuecomment-1296368897, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGRR3EUO5KPLEKNRMKNK7DWF33LRANCNFSM6AAAAAARLMMPDE . You are receiving this because you commented.Message ID: @.***>

Luuk34 commented 1 year ago

Thanks!, I must have overlooked that option. This is making this plugin even better... 😉