Re: Equivalent query
Posted in 2006
Thanks a lor, but the skip resulted in an error:
[Informix][Informix ODBC Driver][Informix]A syntax error has occurred.
So I guess I have not that version (10.0), the problem is that I have
only access to these informix views but no control of the database
Is there another solution to do something like this???
and can someone give me an idea of using variables in informix??
THANKS A LOT
Luis Saavedra
DECLARE @var1 integer
SET @var1 = (select count(*) from table)
DECLARE @var2 integer
SET @var2 = 200
select top (@var1 - @var2) * from table
Link, David A. (Omaha) wrote:
> IDS Version 10.0 will allow you to do the following:
>
>
>
> SELECT SKIP 50 FIRST 10 a, b FROM tab1;>
>
>
>
>
> ________________________________
>
> From: informix-list-bounces@iiug.org
> [mailto:informix-list-bounces@iiug.org] On Behalf Of DORN B
> Sent: Wednesday, October 04, 2006 8:14 PM
> To: luissol
> Cc: informix-list@iiug.org
> Subject: Re: Equivalent query
>
>
>
> TRY: SELECT FIRST <NUMBER OF ROWS> * FROM <TABLE>
>
> On 4 Oct 2006 16:41:32 -0700, luissol <luissol@gmail.com> wrote:
>
> Hello
>
> I have a question is there an equivalent of the "TOP" function of sql
> server in informix
>
> I need something like this but in the informix sintax:
>
> DECLARE @var1 integer
> SET @var1 = (select count(*) from table)
> DECLARE @var2 integer
> SET @var2 = 200
> select top (@var1 - @var2) * from table
>
> I'm using C# to develop my application that has access to informix but
>
> _______________________________________________
> Informix-list mailing list
> Informix-list@iiug.org
> http://www.iiug.org/mailman/listinfo/informix-list
>
>
>
>
> ------_=_NextPart_001_01C6E824.41C28871
> Content-Type: text/html
> Content-Transfer-Encoding: quoted-printable
> X-Google-AttachSize: 4878
>
> <html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
>
> <head>
> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
> <meta name=Generator content="Microsoft Word 11 (filtered medium)">
> <!--[if !mso]>
> <style>
> v\\:* {behavior:url(#default#VML);}
> o\\:* {behavior:url(#default#VML);}
> w\\:* {behavior:url(#default#VML);}
> .shape {behavior:url(#default#VML);}
> </style>
> <![endif]-->
> <style>
> <!--
> /* Font Definitions */
> @font-face
> {font-family:Tahoma;
> panose-1:2 11 6 4 3 5 4 4 2 4;}
> /* Style Definitions */
> p.MsoNormal, li.MsoNormal, div.MsoNormal
> {margin:0in;
> margin-bottom:.0001pt;
> font-size:12.0pt;
> font-family:"Times New Roman";}
> a:link, span.MsoHyperlink
> {color:blue;
> text-decoration:underline;}
> a:visited, span.MsoHyperlinkFollowed
> {color:blue;
> text-decoration:underline;}
> pre
> {margin:0in;
> margin-bottom:.0001pt;
> font-size:10.0pt;
> font-family:"Courier New";}
> span.EmailStyle18
> {mso-style-type:personal-reply;
> font-family:Arial;
> color:navy;}
> @page Section1
> {size:8.5in 11.0in;
> margin:1.0in 1.25in 1.0in 1.25in;}
> div.Section1
> {page:Section1;}
> -->
> </style>
>
> </head>
>
> <body lang=EN-US link=blue vlink=blue>
>
> <div class=Section1>
>
> <p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
> 10.0pt;font-family:Arial;color:navy'>IDS Version 10.0 will allow you to do the
> following:<o:p></o:p></span></font></p>
>
> <p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
> 10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
>
> <pre><font size=2 color=black face="Courier New"><span style='font-size:10.0pt;
> color:black'>SELECT SKIP 50 FIRST 10 a, b FROM tab1;<o:p></o:p></span></font></pre>
>
> <p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
> 10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
>
> <p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
> 10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
>
> <div>
>
> <div class=MsoNormal align=center style='text-align:center'><font size=3
> face="Times New Roman"><span style='font-size:12.0pt'>
>
> <hr size=2 width="100%" align=center tabindex=-1>
>
> </span></font></div>
>
> <p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
> font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
> face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
> informix-list-bounces@iiug.org [mailto:informix-list-bounces@iiug.org] <b><span
> style='font-weight:bold'>On Behalf Of </span></b>DORN B<br>
> <b><span style='font-weight:bold'>Sent:</span></b> Wednesday, October 04, 2006
> 8:14 PM<br>
> <b><span style='font-weight:bold'>To:</span></b> luissol<br>
> <b><span style='font-weight:bold'>Cc:</span></b> informix-list@iiug.org<br>
> <b><span style='font-weight:bold'>Subject:</span></b> Re: Equivalent query</span></font><o:p></o:p></p>
>
> </div>
>
> <p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
> 12.0pt'><o:p> </o:p></span></font></p>
>
> <p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
> face="Times New Roman"><span style='font-size:12.0pt'>TRY: SELECT FIRST
> <NUMBER OF ROWS> * FROM <TABLE><o:p></o:p></span></font></p>
>
> <div>
>
> <p class=MsoNormal><span class=gmailquote><font size=3 face="Times New Roman"><span
> style='font-size:12.0pt'>On 4 Oct 2006 16:41:32 -0700, <b><span
> style='font-weight:bold'>luissol</span></b> <<a
> href="mailto:luissol@gmail.com">luissol@gmail.com</a>> wrote:</span></font></span>
> <o:p></o:p></p>
>
> <p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
> 12.0pt'>Hello<br>
> <br>
> I have a question is there an equivalent of the "TOP" function of sql<br>
> server in informix <br>
> <br>
> I need something like this but in the informix sintax:<br>
> <br>
> DECLARE @var1 integer<br>
> SET @var1 = (select count(*) from table)<br>
> DECLARE @var2 integer<br>
> SET @var2 = 200<br>
> select top (@var1 - @var2) * from table <br>
> <br>
> I'm using C# to develop my application that has access to informix but<br>
> <br>
> _______________________________________________<br>
> Informix-list mailing list<br>
> <a href="mailto:Informix-list@iiug.org">Informix-list@iiug.org </a><br>
> <a href="http://www.iiug.org/mailman/listinfo/informix-list">http://www.iiug.org/mailman/listinfo/informix-list</a><o:p></o:p></span></font></p>
>
> </div>
>
> <p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
> 12.0pt'><o:p> </o:p></span></font></p>
>
> </div>