little-brother / sqlite-gui

Lightweight SQLite editor for Windows
GNU General Public License v2.0
1.07k stars 51 forks source link

Formatting breaks query with == #113

Closed jungle-boogie closed 2 years ago

jungle-boogie commented 2 years ago

Hi,

Notice this query has two = symbols:

select b.author, b.title, printf("%.2f", avg(r.rating)) rating, count(1) review_count
from reviews r inner join books b on r.book_id == b.id
group by r.book_id
order by 4 desc, 3 desc
limit 5;

Run it through the formatting, then execute query.

Notice the query is now broken:

inner join books b on r.book_id = = b.id 

Thanks!

little-brother commented 2 years ago

== is a not a valid construction.

jungle-boogie commented 2 years ago

Ah, I see.

I'm using the bookstore database and a view had ==.

The v_popular5 view.