addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwchatcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscrosseditemptyheartfacebookfolderfullheartglobegmailgoogleimagesinstagramlinklocation-pinmagnifying-glassmailminusmoremuplabelShape 3 + Rectangle 1outlookpersonplusprice-ribbonImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruseryahoo

The San Diego PostgreSQL Meetup Group Message Board › New Meetup: SDPUG November 2010 meetup

New Meetup: SDPUG November 2010 meetup

Joe C.
jconway
Group Organizer
El Cajon, CA
Announcing a new Meetup for The San Diego PostgreSQL Meetup Group!

What: SDPUG November 2010 meetup

When: Thursday, November 11, 2010 7:00 PM

Where: Panera Bread
5500 Grossmont Center Dr
La Mesa, CA 91942
(619) 464-4400

Agenda:

1) Welcome/introduction of new members
2) Topic(s) of the month:

PgWest 2010 recap

3) Group discussion (bring self contained example problems)

RSVP to this Meetup:
http://www.meetup.com...­
Guyren G H.
gisborne
Santee, CA
Post #: 1
How I format my SQL:

SELECT
..foo,
..bar as baz,
..bip
FROM
..table1 JOIN
..table2 ON (something) JOIN
..table3 ON (something_else)
WHERE (
....x = 1 AND
....y = 2 AND
....z = someFn(a))
..OR (
....a = 3 AND
....b = a)
..OR NOT (
......z = y
....OR
......a = b AND
......c = d)
ORDER BY
..foo

ie put all the things that you have by default on the right, and use indentation to show bracketing

Note: stupid site strips out leading spaces, so I used periods.
Guyren G H.
gisborne
Santee, CA
Post #: 2
How to quickly find the next record:

SELECT
..*
FROM
..sometable
WHERE
..name > (
....SELECT
......name
....FROM
......sometable
....WHERE
......id = <current_id>)
ORDER BY
..name
LIMIT 1

For the previous record, do ... WHERE name < ... ORDER BY name ASC ...

Note: stupid site strips out leading spaces, so I used periods
Powered by mvnForum

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy