MS SQL 2008 R2 Queryanalyzer在代码中成功运行。 LOGO应用程序中的SQL代码字段失败正在运行

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MS SQL 2008 R2 Queryanalyzer在代码中成功运行。 LOGO应用程序中的SQL代码字段失败正在运行相关的知识,希望对你有一定的参考价值。

程序员和开发人员,

MS SQL 2008 R2 Queryanalyzer在代码中成功运行。 LOGO应用程序中的SQL代码字段失败正在运行。

错误:

" The order by clause is invalid in views, inline functions,derived tables,subqueries and common table expressions,unless TOP or FOR XML is also specified"

这将以等宽字体显示。前四个空格将被删除,但所有其他空格将被保留。

我的代码:

printf("goodbye world!");  /* his suicide note
                              was in C */

SELECT PLN.[DATE_] AS 'TARİH',
          CC.DEFINITION_ AS 'Cari Kodu',
          TANA.DONEM AS 'MNL_Dönem',
          CASE 
        WHEN TANA.Oda_Tipleri='1' THEN 'Tek Kişilik'
        WHEN TANA.Oda_Tipleri='2' THEN '2 kişilik'
        WHEN TANA.Oda_Tipleri='3' THEN '3 kişilik'
        WHEN TANA.Oda_Tipleri='4' THEN '4 kişilik'
        WHEN TANA.Oda_Tipleri='5' THEN '2 kişilik odada TEK kişi'
        WHEN TANA.Oda_Tipleri='6' THEN '3 kişilik odada 2 kişi'
    ELSE 'SEÇİLMEMİŞ'
 END 'Oda_Tipi',
CASE        WHEN TANA.Oda_Ozellik= '1'      THEN 'Dışa Bakan Oda ' 
        WHEN TANA.Oda_Ozellik= '2'  THEN 'Kurangleze Bakan Oda ' 
        WHEN TANA.Oda_Ozellik= '3'  THEN 'İçe Bakan Oda ' 
        WHEN TANA.Oda_Ozellik= '4'  THEN 'Arkaya Bakan Oda '
        WHEN TANA.Oda_Ozellik= '5'  THEN 'Öne Bakan Oda '
    ELSE 'SEÇİLMEMİŞ'
END Oda_Ozellik,

CASE
        WHEN TANA.Sene_Bilgisi = '1' THEN '2011/2012 ' 
        WHEN TANA.Sene_Bilgisi = '2' THEN '2012/2013 ' 
        WHEN TANA.Sene_Bilgisi = '3' THEN '2013/2014 ' 
        WHEN TANA.Sene_Bilgisi = '4' THEN '2014/2015 ' 
        WHEN TANA.Sene_Bilgisi = '5' THEN '2015/2016 ' 
        WHEN TANA.Sene_Bilgisi = '6' THEN '2016/2017 ' 
        WHEN TANA.Sene_Bilgisi = '7' THEN '2017/2018 ' 
        WHEN TANA.Sene_Bilgisi = '8' THEN '2018/2019 ' 
        WHEN TANA.Sene_Bilgisi = '9' THEN '2019/2020 ' 
    ELSE 'SEÇİLMEMİŞ'
END Sene_Bilgisi,
CASE 
        WHEN TANA.Donem_Bilgisi = '1' THEN 'Güz ' 
        WHEN TANA.Donem_Bilgisi = '2' THEN 'Bahar '
        WHEN TANA.Donem_Bilgisi = '3' THEN 'Yaz '  
    ELSE 'SEÇİLMEMİŞ'
END Donem_Bilgisi,

CASE 
        WHEN TANA.Burs_Tipi = '1' THEN 'YÖK' 
        WHEN TANA.Burs_Tipi = '2' THEN '%25 Yönmetim Bursu' 
        WHEN TANA.Burs_Tipi = '3' THEN '%50 Yönmetim Bursu' 
        WHEN TANA.Burs_Tipi = '4' THEN '%75 Yönmetim Bursu' 
        WHEN TANA.Burs_Tipi = '5' THEN '%100 Yönmetim Bursu' 
        WHEN TANA.Burs_Tipi = '6' THEN '%50 Yurt Kredisi' 
        WHEN TANA.Burs_Tipi = '7' THEN '%100 Yurt Kredisi' 
        WHEN TANA.Burs_Tipi = '8' THEN '%100 Yönetim Burdu Mezuniyete Kadar' 
        WHEN TANA.Burs_Tipi = '9' THEN '%50 Burs %50 Yurt Kredisi' 
    ELSE 'Burssuz veya Seçilmemiş'
END Cinsiyet_Tipi,  

CASE 
        WHEN TANA.Cinsiyet_Tipi = '1' THEN 'Erkek ' 
        WHEN TANA.Cinsiyet_Tipi = '2' THEN 'Kız ' 
    ELSE 'SEÇİLMEMİŞ'
END Cinsiyet_Tipi,
CASE 
        WHEN TANA.Uyruk= '0' THEN 'TC ' 
        WHEN TANA.Uyruk= '1' THEN 'Diğer ' 
        ELSE 'SEÇİLMEMİŞ'
END Uyruk,

PLN.[FICHEREF] As 'Sipariş Referansı',
SIP.SPECODE As 'Sip.ÖK',
SIP.FICHENO As 'Sip.No',
SIP.DOCODE As 'Sip.Belge No',
CASE WHEN (FAT.[FICHENO] IS NULL) THEN '0' WHEN (FAT.[FICHENO] IS NOT NULL) THEN FAT.[FICHENO] END AS 'Fatura No',
PLN.[TRCODE],
PLN.[TOTAL] AS 'PLN Taksit Tutarı',
CASE WHEN (FAT.[NETTOTAL] IS NULL) THEN '0' WHEN (FAT.[NETTOTAL] IS NOT NULL) THEN FAT.[NETTOTAL] END AS 'Kesilen.Fat.Tut',
CASE WHEN (PLN.[TOTAL]- FAT.[NETTOTAL] IS NOT NULL) THEN '0' WHEN (PLN.[TOTAL]- FAT.[NETTOTAL] IS NULL) THEN 'Faturalanmamış' END AS 'FARK',
CASE WHEN (FAT.[TOTALVAT] IS NULL) THEN '0' WHEN (FAT.[TOTALVAT] IS NOT NULL) THEN FAT.[TOTALVAT] END AS 'Kesilen KDV',
CASE WHEN (FAT.[TOTALVAT] IS NOT NULL) THEN '0' WHEN (FAT.[TOTALVAT]IS NULL) THEN ROUND((PLN.[TOTAL]-(PLN.[TOTAL]/1.08)),2) END AS 'KesileCEK KDV',
PLN.[CANCELLED] As 'İPTAL Durumu',
PLN.[MODIFIED],
PLN.[PAYNO] AS 'Öd.Pln.Satırı',
CASE WHEN (FAT.[TRACKNR] IS NULL) THEN 'Faturalanmamış' WHEN (FAT.[TRACKNR] IS NOT NULL) THEN FAT.[TRACKNR] END AS 'FAT.SIRA.NO'
FROM LG_011_01_PAYTRANS AS PLN 
LEFT OUTER JOIN LG_011_CLCARD CC ON
CC.LOGICALREF = PLN.CARDREF LEFT OUTER JOIN
LG_011_01_INVOICE AS FAT ON  PLN.FICHEREF=FAT.DOCTRACKINGNR AND FAT.TRACKNR=PLN.PAYNO     LEFT OUTER JOIN
LG_011_01_ORFICHE AS SIP ON  PLN.FICHEREF=SIP.LOGICALREF INNER JOIN
LG_XT1015_011 AS TANA ON CC.LOGICALREF=TANA.PARLOGREF
Where MODULENR=3 
ORDER BY  PLN.[DATE_] ASC

此外,任何报告的应用程序,运行顺利的t-sql代码,queryanalzer。如果堆栈溢出错误可以从堆栈中识别出来,那么转换数据有可能吗?如何?您可以找到一个逐步解释视频的文档?

错误明细: cpu registers: eax = 0d3e2f60 ebx = 0d40ef98 ecx = 00000000 edx = 0042967e esi = 00000019 edi = 0012fc24 eip = 0042967e esp = 0012efa8 ebp = 0012f004

答案

如果这是错误消息 - “order by子句在视图,内联函数,派生表,子查询和公用表表达式中无效,除非还指定了TOP或FOR XML”,则应输入“TOP 100 PERCENT”声明中使用“订单”的条款。

在你的情况下,我想它将是:

SELECT    TOP 100 PERCENT
          PLN.[DATE_] AS 'TARIH',
          CC.DEFINITION_ AS 'Cari Kodu',
          TANA.DONEM AS 'MNL_Dönem',
          CASE 
          ...

以上是关于MS SQL 2008 R2 Queryanalyzer在代码中成功运行。 LOGO应用程序中的SQL代码字段失败正在运行的主要内容,如果未能解决你的问题,请参考以下文章

从 SQL 2008 R2 到 MS Access 的链接服务器

无法使用 Liferay 6.2 连接 MS SQL Server management studio 2008 r2

MS SQL Server 2008 R2 常规操作

SQL Server 2008r2 <--> 前端 MS Access 的最佳版本

MS SQL 2008 R2 Queryanalyzer在代码中成功运行。 LOGO应用程序中的SQL代码字段失败正在运行

Window 2008 Tomcat 7 MS SQL Server 2008R2 - 无法识别JNDI JDBC驱动程序