1

我正在尝试将以下文本插入到表格单元格中,即varchar(8000).

SELECT DISTINCT TOP 100 * 
FROM  
    (SELECT TOP 10000 * 
     FROM 
        (SELECT DISTINCT 
             rklient, nimi + ISNULL('(' + UPPER(oleknimi) + ')' ,'') AS nimi,
             mkood, kommentaar, regkood,
             ISNULL(aadress + ' ','') AS aadress, 
             naitatel AS telefon, NULL AS lepingutelefon, 
             faks, email, www, NULL AS sisu, iprowid, 
             varvikood, klient, saitrank AS rank, emaid, 'F' AS typ, 
             infobaas, x, y, ISNULL(lahtiolekuaeg,'none') as lahtiolekuaeg, 
             lahtikomment, NULL AS koiksynid, paigutus, nimeviide, kupong  
         FROM 
             table_name WHERE reanr = '10') Tulemus) e 
WHERE 
    nimeviide IS NULL  
ORDER BY 
    rank DESC, iprowid

它给了我不正确的语法。我想是因为这个:'

我该如何解决这个问题?

4

1 回答 1

2

'您可以通过简单地将字符加倍来引用该字符''

例子:

   SELECT 'This is q single quote ''';
于 2012-06-12T06:30:37.363 回答