pypika icon indicating copy to clipboard operation
pypika copied to clipboard

Distinct method is not documented

Open andreamoro opened this issue 3 years ago • 4 comments

How you guys would expect a distinct to be written?

I can't see any viable method and the only solution I can think of is a small hack to parse the returned sql and split immediately after the SELECT statement. Not elegant, but it can work I guess.

Any idea is welcome

andreamoro avatar Oct 09 '20 15:10 andreamoro

Query.from_("abc").select("foo").distinct()

'SELECT DISTINCT "foo" FROM "abc"'

gl3nn avatar Oct 09 '20 16:10 gl3nn

Worth updating the main guide then, because I based my comment from that.

andreamoro avatar Oct 09 '20 17:10 andreamoro

Hmm makes sense, I'll leave the ticket open with a documentation label.

gl3nn avatar Oct 09 '20 17:10 gl3nn

@gl3nn I created a new README.rst for this issue but couldn't push my changes to a branch I made (403 error). I was able to authenticate with Gitub using my browser credentials so not sure of the issue. ANy ideas?

info-rchitect avatar Mar 19 '21 14:03 info-rchitect