Databases

doug o'donnell
doug o'donnell
11,564 Points

Where to put the from keyword

Do you have to put the from keyword at the end pf the query or can it be anywhere in the query

1 Answer

Steven Parker
Steven Parker
176,778 Points

Query syntax is pretty rigid about clause order, but since many clauses are optional the layout will vary with what's being done. For example, the FROM clause must come after the SELECT clause, but before a WHERE clause.

So the FROM wouldn't always be last, but it might be if you have no WHERE.