Subject Re: sql distinct syntax
Author Adam
Quoting from my message yesterday:

*****

Another thing, do not reply to another post. Yahoo Groups is threaded,
which means that people using Newsreaders can choose to ignore an
entire thread if it is not of interest for them. These people will
never see your question. Changing the subject is not sufficient, the
flag is inside the header of the email. Instead, compose a new email
and everyone will see it.

*****

Please only reply if your post is relevant to the post you are
replying to.

--- In firebird-support@yahoogroups.com, geo.mastique@... wrote:
>
> hi,
> i use the distinct sql intruction in a query so as to return only one
> time a value :
>
> select distinct myfield for mytable.
>
> is it more quick to use a group by instruction ??? as :
> select myfield for mytable
> group by myfield
>
> this question is maybe more sql topic than Firebird topic but maybe
> firebird is better with the first or second instruction ???

It should make no difference to the plan the database uses, but to a
human the first is more understandable and so should be prefered. You
can always check the plan of a query through iSQL or pretty much any
other visual tool, and that will tell you whether they are indeed the
same.

Adam