Hello everyone
There is the possibility of ordering the result of a SELECT in an order
specified by the user.For examplehaving a field NAMEin the clause ORDER BY
'PAUL, JOHN, PETER, MARIA'
Of course, that should be all the options set
Thank you.
Hola a todos
Existe la posibilidad de ordenar el r
Hello,
I've a litte question. Now I can order by the column number, order by 1. Can
I set this information with a variable?
Dim k as integer = 1;
Order by :k?
Thanks
Hi,
ORDER BY CASE USER_NAME WHEN ‘PAUL’ THEN 1 WHEN ‘JOHN’ THEN 2 .. END
regards,
Karol Bieniaszewski
From: mailto:firebird-support@yahoogroups.com
Sent: Tuesday, October 06, 2015 5:20 PM
To: Firebird Support
Subject: [firebird-support] Order by
Hello everyone
There is the possibility
rd-support@yahoogroups.com Sent:
Tuesday, October 06, 2015 5:20 PMTo: Firebird Support Subject:
[firebird-support] Order by Hello everyone There is the possibility of
ordering the result of a SELECT in an order specified by the user.For
examplehaving a field NAMEin the clause ORDER BY 'PAUL, JOHN, P
ds,
> Karol Bieniaszewski
>
> *From:* mailto:firebird-support@yahoogroups.com
>
> *Sent:* Tuesday, October 06, 2015 5:20 PM
> *To:* Firebird Support
> *Subject:* [firebird-support] Order by
>
>
> Hello everyone
>
> There is the possibility of ordering the result of a SELE
s.com Sent:
Tuesday, October 06, 2015 5:20 PMTo: Firebird Support Subject:
[firebird-support] Order by Hello everyone There is the possibility of
ordering the result of a SELECT in an order specified by the user.For
examplehaving a field NAMEin the clause ORDER BY 'PAUL, JOHN, PETER, MARI
ple. Thank Karol
>
>
>
>
> El Martes, 6 de octubre, 2015 16:32:08, "liviusliv...@poczta.onet.pl
> [firebird-support]" escribió:
>
>
>
> Hi,
>
> ORDER BY CASE USER_NAME WHEN ‘PAUL’ THEN 1 WHEN ‘JOHN’ THEN 2 .. END
>
> regards,
> Karol Bieniasze
I don't think so.
And anyway, you should never be using an order by number - unless there is
really no way around it, in my opinion.
A
On Mon, Apr 7, 2014 at 11:47 AM, checkmail wrote:
>
>
> Hello,
>
>
>
> I've a litte question. Now I can order by the column number, order by 1.
> Can I set th
On 07/04/2014 12:40, Andrea Raimondi wrote:
And anyway, you should never be using an order by number - unless
there is really no way around it, in my opinion.
When people make statements like that it would be really helpful if they
were to say *why* they are of this opinion, otherwise the read
I am of this opinion because SQL scripts change and what is today column
number 2 may become column number 14 two days later.
This, in turn, leads to potential problems because you think it's ordering
by something whereas instead it's ordering by something else.
A
On Mon, Apr 7, 2014 at 2:58 PM,
Thanks. Knowing this reasoning, one can then use one's judgement in
comparing this reason against a desire to avoid repeating a long complex
expression which could also lead to a maintenance risk.
On 07/04/2014 15:02, Andrea Raimondi wrote:
I am of this opinion because SQL scripts change and wh
To avoid those cases, I will usually wrap the long and complex expression
in an outer select giving it an intuitive column name.
It does not work in *all* cases, but it does work in most.
A
On Mon, Apr 7, 2014 at 3:05 PM, Tim Ward wrote:
>
>
> Thanks. Knowing this reasoning, one can then use o
On Mon, Apr 7, 2014 at 6:47 AM, checkmail wrote:
>
>
> I've a litte question. Now I can order by the column number, order by 1.
> Can I set this information with a variable?
>
> Dim k as integer = 1;
>
> Order by :k?
>
>
>
You can do the equivalent with an EXECUTE STATEMENT.With the exception
Thanks @ll J
Von: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] Im Auftrag von Ann Harrison
Gesendet: Montag, 7. April 2014 17:30
An: firebird-support@yahoogroups.com
Betreff: Re: [firebird-support] order by
On Mon, Apr 7, 2014 at 6:47 AM, checkmail wrote
I'm building a major product using Lazarus 1.8.4, FPC 3.0.4, IBX 2.3.3 and
Firebird RDBMS 3x. I have a query that runs in the range of 1 to 3
milliseconds without the ORDER BY clause. But once I add the ORDER BY clause,
the query takes > 1.5 seconds. Be advised that there is an index on the
hi--
always a great place to get help!!
here's what i have data wise:
Tag ID Date
ABC 11 2012
DEF 11 2011
GHJ 11 2010
HHH 22 2012
ZZZ 22 2011
AAA 22 2010
AAK 33 2012
AAD 44 2012
YYY 44 2010
IF i select * order by t
Hiyes, slowdown is because of sort as engine must sort the table first and then
retrieve 10 records.But you can try to speed this up by:SELECT FIRST 10 SKIP 0
msg.OBJ_GUID AS "MSG_GUID", msg.PRTY, msg.TTL, pst.OBJ_GUID AS "PST_GUID",
pst.MSTB_DTSFROM (Select * from MSGS m order by m.PRTY) ms
Hello,
I guess this is another beginners question:
I have a table with 300`000 entries.
Each row has a separate field TIMESTAMP with its creation data.
Now, I query the latest 100 hundred using:
select first(100) X, Y, TIMESTAMP
from MY_TABLE
order by TIMESTAMP DESC -- order by takes all the t
Kelly,
> always a great place to get help!!
>
> here's what i have data wise:
>
> Tag ID Date
>
> ABC 11 2012
> DEF 11 2011
> GHJ 11 2010
> HHH 22 2012
> ZZZ 22 2011
> AAA 22 2010
> AAK 33 2012
> AAD 44 2012
> YYY 44
hi:
select
A.Codigo
'DINHEIRO' FORMA_PAGTO
FROM NF A
where A.dataEmissao between '01.01.2018' and '31.01.2018'
and A.Modelo = '55'
order by 1, 2
using, "order by 2", return a error but, if i use: cast('DINHEIRO' as
varchar(10)) FORMA_PAGTO does not ocorrur.
HiWithout analysis i can only advice to create descending index.Create
descending index ixd_mytable__timestamp on mytable(timestamp)Regards,Karol
Bieniaszewski
null
Hello,
it seems the problem is related to the VIEW. This is what I also figured
out so far. Now I read:
"If you see a *NATURAL *plan going against a big table, you've found the
problem. If you have where clause or JOIN to that table, make sure you have
index defined on related fields. If you do h
: [firebird-support] order by takes too long
Hello,
it seems the problem is related to the VIEW. This is what I also figured out so
far.. Now I read:
"If you see a NATURAL plan going against a big table, you've found the problem.
If you have where clause or JOIN to that table, make sur
@yahoogroups.com [mailto:
> firebird-support@yahoogroups.com]
> *Gesendet:* Dienstag, 3. März 2020 12:41
> *An:* firebird-support@yahoogroups.com
> *Betreff:* Re: [firebird-support] order by takes too long
>
>
>
>
>
> Hello,
>
>
>
> it seems the problem is related t
03.03.2020 13:23, Matthias Winkler spmm...@gmail.com [firebird-support] wrote:
> The question is when and how decides the generator
> of the "plan" that it connot use the indexes
http://www.ibase.ru/dataaccesspaths/
--
WBR, SD.
--
Betreff: Re: [firebird-support] order by takes too long
Hello,
I already re-calculated the indexes. But as far as I understood is that as soon
as the natural keyword is present the indexes are not used at all.
The question is when and how decides the generator
of the "plan" that it conn
How to best implement ORDER BY of a query when the field by which to
order, is given as stored procedure input parameter?
for example a typical product list where could be ordered by Name, Price
etc fields depending on what user clicks.
I tried to include it into query:
for
select f1, f2 from t
Hi all,
is it possible to pass a variable into a Order by ?
I did it and the StoredProcedure was created without errors
but the variable passed into an 'order by' was ignored and firebird
assumed the primary key order instead
any tip ?
thanks
--
acgomes2...@yahoo.com.br wrote:
> select
> A.Codigo
> 'DINHEIRO' FORMA_PAGTO
> FROM NF A
> where A.dataEmissao between '01.01.2018' and '31.01.2018'
> and A.Modelo = '55'
This should work fine if you place a comma after A.Codigo. It does
not make any sense to ORDER BY 2 (nor ORDER BY 1,2)
hi helen... the comma is the less problem...
A correct sql:
select N.DTEMISSAONOTA as DATA,
'DINHEIRO' as MEIO_PAGAMENTO1,
cast('DINHEIRO' as char(10)) as MEIO_PAGAMENTO2,
'00' as MEIO_PAGAMENTO,
N.VLRTOTALNOTA as VALOR,
0 as AUTENT_01,
0 a
This advice should be oppositeYou should not have order by in the view.Only
exception is when you always do only simple select * from myviewRegards,Karol
Bieniaszewski
null
Hello,
I tried the sorting inside and outside a minimal view and it actually
worked in both cases without non-indexed reads,
meaning FAST.
By stripping down my complex view it turned out that a "inner join" with
another table inside the view killed my performance.
I will now try to evaluate if I
HiYou can always change inner join to pseudo inner join without affecting
resultset. But better you should find the reason of this slowdown as it looks
like index without recent stats or wrong indexing in join. But it also can be
something else.Regards,Karol Bieniaszewski
null
Hi Karol,
Thanks for your reply.
Can you outline how I would do a "inner join to pseudo inner join without
affecting resultset".
Matthias
On Wed, Mar 4, 2020 at 10:12 AM liviuslivius liviusliv...@poczta.onet.pl
[firebird-support] wrote:
>
>
> Hi
>
> You can always change inner join to ps
Pseudo inner join is left join with where clause about not null from left
joined tableSelectFromTable1 t1 left join Table2 t2 on
t1.id=t2.id_t1Wheret2.id is not nullRegards,Karol Bieniaszewski
null
Hi Karol,
perfect! I usually say that I hate DBs but
the more I gain deep insights I start to like it.
Thank you for your help!
Matthias
liviuslivius liviusliv...@poczta.onet.pl [firebird-support] <
firebird-support@yahoogroups.com> schrieb am Mi., 4. März 2020, 19:38:
>
>
> Pseudo inner join
Hi All,
I have below SQL, which is concatenating the ShortCode column data, but without
ordering as per the ORDER_NUMBER column in ABC table in "WITH" clause.
Please help.
With TBL_SHORT_CODE (SHORT_CODE, FK_KEY) As (SELECT Distinct(XYZ.SHORT_CODE) As
SHORT_CODE, ABC.FK_KEY From ABC Join XYZ On
At 09:26 AM 19/03/2012, Newbie wrote:
>How to best implement ORDER BY of a query when the field by which to
>order, is given as stored procedure input parameter?
It is not possible to that directly, as ORDER BY is a structural element that
is pre-compiled.
>for example a typical product list wh
On Sun, 18 Mar 2012 22:26:11 +0200, Newbie wrote:
> How to best implement ORDER BY of a query when the field by which to
> order, is given as stored procedure input parameter?
> for example a typical product list where could be ordered by Name, Price
> etc fields depending on what user clicks.
>
> How to best implement ORDER BY of a query when the field by which to
> order, is given as stored procedure input parameter?
If the data set returned by the procedure is not very large, return all
relevant fields from the procedure and use order by in the query
selecting from the procedure (it
On Tue, Mar 20, 2012 at 12:48 PM, Tomasz Tyrakowski <
t.tyrakow...@sol-system.pl> wrote:
> > How to best implement ORDER BY of a query when the field by which to
> > order, is given as stored procedure input parameter?
>
> If the data set returned by the procedure is not very large, return all
>
executing it with
execute statement, with risk for SQL injection.
Mark
- Reply message -
Van: "Gugui gugui_sarubi_mac...@yahoo.com.br [firebird-support]"
Aan:
Onderwerp: [firebird-support] Order by :variable in a Stored Procedure
Datum: di, nov. 3, 2015 19:58
Hi all,
is it possible
On Fri, 3 Jul 2015 12:15:31 + (UTC), "Vishal Tiwari
vishuals...@yahoo.co.in [firebird-support]"
wrote:
> Hi All,
> I have below SQL, which is concatenating the ShortCode column data, but
> without ordering as per the ORDER_NUMBER column in ABC table in "WITH"
> clause.
> Please help.
>
> With
Even if I don't use Distinct, i don't get expected result.
On Friday, 3 July 2015 7:17 PM, "Mark Rotteveel m...@lawinegevaar.nl
[firebird-support]" wrote:
On Fri, 3 Jul 2015 12:15:31 + (UTC), "Vishal Tiwari
vishuals...@yahoo.co.in [firebird-support]"
wrote:
> Hi All,
> I ha
get a deterministic order.
Mark
- Reply message -
Van: "Vishal Tiwari vishuals...@yahoo.co.in [firebird-support]"
Aan: "firebird-support@yahoogroups.com"
Onderwerp: [firebird-support] Order By Not Working Using "WITH" Clause
Datum: vr, jul. 3, 2015 17:00
Even i
>Hi All,
>
>I have below SQL, which is concatenating the ShortCode column data, but
>without ordering as per the ORDER_NUMBER column in ABC table in "WITH" clause.
>
>Please help.
>
>With TBL_SHORT_CODE (SHORT_CODE, FK_KEY) As
>(
>SELECT Distinct(XYZ.SHORT_CODE) As SHORT_CODE, ABC.FK_KEY
>From A
Hi SET,
You have done it this time too
Your SQL worked with a small amount of change in below statement
DECLARE VARIABLE FK_BOM2 VARCHAR(2000);
Because FK_BOM2 is of GUID type.
You are awesome as usual.
I would like to say Thank You from bottom of HEART
Thanks Once Again SET... You A
47 matches
Mail list logo