question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add parenthesis around subquery

See original GitHub issue

Is your feature request related to a problem? Please describe. I’m always frustrated when I want to add () around a subquery to use it as a where clause, the selected text gets deleted and replaced by (

Describe the solution you’d like Imagine this scenario, you have a query to get the department id:

select id from departments where name = 'IT'

Now, you want to know all the people working on this department so you go ahead and:

select * from employees where deparment_id in

Right here, you might want to select the first query with the cursor and press ( right, It would be awesome if after that the query can get wrapped by parenthesis, Currently, when you do that, the query is deleted and removed by the parenthesis.

Describe alternatives you’ve considered Same as above

Additional context The above-mentioned feature is part of PgAdmin. I only hate it after PgAdmin started to work only in the browser and then I switched to DBeaver and this seems a nice to have feature

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
uslsscommented, Nov 23, 2020

thanks for the report.

Seems the feature is working but not in all cases 2020-11-23_17h13_04

0reactions
LonwoLonwocommented, Mar 16, 2021

Now I close this ticket, because it seems that problem solved - the wrapping in the brackets is supported by DBeaver.

Feel free to reopen the ticket if you appear additions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

sql - Adding parenthesis around SELECT expression gives an ...
1 Answer 1 ... A SELECT statement enclosed in parentheses is a subquery. All types of SELECT statement, including aggregate and compound SELECT ......
Read more >
SQL - Sub Queries - Tutorialspoint
Subqueries must be enclosed within parentheses. A subquery can have only one column in the SELECT clause, unless multiple columns are in the...
Read more >
5 Ways to Better Understand SQL by Adding Optional ...
5 Ways to Better Understand SQL by Adding Optional Parentheses · 1. Row value expressions · 2. JOINs · 3. DISTINCT · 4....
Read more >
Writing Subqueries in SQL | Advanced SQL - Mode Analytics
Subqueries are required to have names, which are added after parentheses the same way you would add an alias to a normal table....
Read more >
SQL Subqueries - w3resource
The subquery can be nested inside a SELECT, INSERT, UPDATE, ... (also called the 'inner query') is the query inside the parentheses.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found