Re:SQL queries don't start with SELECT
by lucb1e on Thursday October 03, 2019 @06:42PM
(#21153024)
Unless I have the whole query in my head by the time I've typed "$db->query(", I will indeed start with the FROM by just typing the placeholder SELECT * and then revisiting the asterisk when I'm done with (most of) the query. Somehow that makes it easier, especially with complex queries.
[ Parent
| on HN ]
Re:SQL queries don't start with SELECT
by mritchie712 on Friday October 04, 2019 @02:16PM
(#21160346)
I do this too, so the autocomplete in SeekWell automatically does this, check it out:
https://www.loom.com/share/9c7979a163eb4513b3320e6e90c66079
If you type just a table name into an empty cell it will autocomplete with a full SELECT statement. e.g. if you typed "pubuser" and selected "public.users" it would autocomplete with:
SELECT pu.*
FROM public.users AS pu
WHERE 1=1
Disclaimer: I built this.