Shorter SQL statements by abbreviating table prefixes
Instead of writing:
SELECT books.title, books.short, books.releasedate, authors.firstname, authors.lastname
FROM books, authors
WHERE books.author_id = authors.id AND authors.id = 21
You can write:
SELECT b.title, b.short, b.releasedate, a.firstname, a.lastname
FROM books b, authors a
WHERE b.author_id = a.id AND a.id = 21
Instead of writing:
SELECT books.title, books.short, books.releasedate, authors.firstname, authors.lastname
FROM books, authors
WHERE books.author_id = authors.id AND authors.id = 21
You can write:
SELECT b.title, b.short, b.releasedate, a.firstname, a.lastname
FROM books b, authors a
WHERE b.author_id = a.id AND a.id = 21
source : http://tutorial101.blogspot.com, http://docstoc.com, http://stackoverflow.com
0 Response to "[Web-development (jquery)] Shorter SQL statements by abbreviating table prefixes"
Post a Comment