Subject Re: [firebird-support] Why there are always one natural file in query
Author Ann W. Harrison
At 06:15 PM 9/8/2004, you wrote:

>I always find I have to try really hard to seperate the tables from the
>fields when underscores are used, especially when the outcome of my scrutiny
>doesnt result in money in my pocket.

Of your three examples, I actually find the first easiest to read,
because that's the way I've written SQL for a decade or more. I'm
probably partly responsible for the underscore convention, having
promoted it at DEC as soon as we got beyond 8 character identifiers,
about the time VMS was invented.

VMS was case-insensitive and tended to up-case things arbitrarily,
so using mixed case to indicate word breaks was a non-starter. DogsHit
is an example of how this goes wrong. The VMS group used some other
convention, but the commercial languages people used "_" - DOGS_HIT.

When answering questions on this list - and I do answer some
from time to time, I start by reformatting the query.
I would immediately suggest that using table aliases rather
than table names improves the code - and avoids much confusion
when queries go recursive.

> tk.ticket_pid, tk.ticket_no, jb.job_order_no,
> st.staff_c_codename, op.oper_c_name, tk.ticket_qty,
> tk.ticket_size_code, tk.ticket_rcv_date
> FROM ticket tk, job_order jb, staff st, oper op
> WHERE op.oper_pid = tk.ticket_oper_pid AND
> st.staff_pid = tk.ticket_rcv_staff_pid AND
> jb.job_order_pid = tk.ticket_jo_pid AND
> tk.ticket_pid > '0'
> ORDER BY tk.ticket_no ;


We have answers.