2017-07-20 9 views
0

私は以下の純粋なmysql質問を持っています。最初の文字を切り捨てるクエリもあります。この前に見たことがない:Mysql Selectは最初の文字を切り捨てて表示します

mysql> select distinct connect_town from ean_publiek where special_connection='1'; 

+--------------------------+ 
| connect_town    | 
+--------------------------+ 
| ANDVOORT    2 | 
| 'T LOO OLDEBROEK  8 | 
| OUDSEND    8 | 
+--------------------------+ 
3 rows in set (0.00 sec)` 

を今ANDVOORTは、その程度の画面を示し、mysqlはWindows 7の下WAMPインストールからである

mysql> select * from ean_publiek where Connect_Postcode='2042JE'; 

+--------------------+--------------------+---------------------+------------------+--------------+------------------+----------------+---------------+------------+-------------------------------+ 
| Connect_EAN  | Connect_Streetname | Connect_HouseNumber | Connect_HouseRef | Connect_Town | Connect_Postcode | Market_Segment | NetOP_EAN  | NetOP_Name | Indication_Special_Connection | 

| 871689294901618151 | Kerkstraat   |     2 | E    | ZANDVOORT | 2042JE   | 27    | 8716892720002 | Stedin NB | 0 
      | 
| 871689294901618168 | Kerkstraat   |     2 | F    | ZANDVOORT | 2042JE   | 27    | 8716892720002 | Stedin NB | 0 
      |` 

から分かるように、ザントフォールトとOUDSENDは、WOUDSENDする必要がありますする必要があります次の詳細:

WampServer Version 3.0.6 64bit Created by Romain Bourdon (2005) Maintainer/Upgrade to 2.5 by Herve Leclerc Upgrade to 3 by Otomatic ([email protected]) Multi styles for homepage by Jojaba Installer by Inno Setup: http://www.jrsoftware.org/isinfo.php Forum Wampserver: http://forum.wampserver.com/index.php 
______________________ Versions used ______________________ Apache 2.4.23 - PHP 5.6.25 - MySQL 5.7.14 PHP 5.6.25 for CLI (Command-Line Interface) 

テーブルは(非常に大きい)dmpファイルから作成され、読み込まれました。

mysql> desc ean_publiek; 
+-------------------------------+-----------------+------+-----+---------+-------+ 
| Field       | Type   | Null | Key | Default | Extra | 
+-------------------------------+-----------------+------+-----+---------+-------+ 
| Connect_EAN     | char(18)  | NO | MUL | NULL |  | 
| Connect_Streetname   | char(24)  | YES | MUL | NULL |  | 
| Connect_HouseNumber   | int(5) unsigned | YES | MUL | NULL |  | 
| Connect_HouseRef    | char(6)   | YES | MUL | NULL |  | 
| Connect_Town     | char(24)  | YES | MUL | NULL |  | 
| Connect_Postcode    | char(6)   | YES | MUL | NULL |  | 
| Market_Segment    | char(3)   | YES | MUL | NULL |  | 
| NetOP_EAN      | char(13)  | YES | MUL | NULL |  | 
| NetOP_Name     | char(24)  | YES | MUL | NULL |  | 
| Indication_Special_Connection | char(1)   | YES | MUL | NULL |  | 
+-------------------------------+-----------------+------+-----+---------+-------+ 
10 rows in set (0.00 sec) 

質問はもちろん、選択した個別クエリが正しい結果を表示するように設定することはできますか?私はこのフォーラムでアラビア語のテキストについての参考文献を見つけましたが、これはアラビア語ではなくオランダです。他の参考文献は欠落行に関するもので、この問題は最初の行ではなく、最初の文字が欠けていることと関係しています。

ありがとうございます!

@EDIT:原因に家にしようと、それが明瞭ではないのです。

mysql> select connect_town from ean_publiek where indication_special_connection='1'; 
+--------------------------+ 
| connect_town    | 
+--------------------------+ 
| ANDVOORT    2 | 
| 'T LOO OLDEBROEK  8 | 
| 'T LOO OLDEBROEK  8 | 
| OUDSEND    8 | 
| OUDSEND    8 | 
+--------------------------+ 
5 rows in set (0.00 sec) 

その他の試み:問題は、select「特定のが原因ではないように見えるん「明確な」同じ誤った結果なしフィールド 'と問題が都市の列よりも、オランダのConnect_Postcodeの下のサンプルでは常にnnnnAB(4桁の2文字)の形式であり、すべてがシフトしたように見えます。具体的には、' Connect_HouseRef '列は' steal ' '列の最初の文字、それの右側など。

mysql> SELECT * from ean_publiek where Indication_special_connection='1'; 

| Connect_EAN  | Connect_Streetname | Connect_HouseNumber | Connect_HouseRef | Connect_Town    | Connect_Postcode | Market_Segment | NetOP_EAN  | NetOP_Name | Indication_Special_Connection | 

| 871689294901618281 | Kerkstraat   |     10 | BC Z   | ANDVOORT    2 | 042JE2   | 7 8   | 716892720002S | tedin NB   0 | 1        | 
| 871687110001572501 | Vierschotenweg  |     28 | B    | 'T LOO OLDEBROEK  8 | 095PR2   | 3 8   | 716871000002L | iander NB   0 | 1        | 
| 871687140022788551 | Vierschotenweg  |     28 | B    | 'T LOO OLDEBROEK  8 | 095PR2   | 7 8   | 716871000002L | iander NB   0 | 1        | 
| 871687120000013011 | Iewal    |     16 | 93 4W   | OUDSEND    8 | 551PT2   | 3 8   | 716871000002L | iander NB   0 | 1        | 
| 871687120000238476 | Midstrjitte  |     30 | 93 4W   | OUDSEND    8 | 551PJ2   | 3 8   | 716871000002L | iander NB   0 | 1        | 
5 rows in set (0.02 sec) 

mysql> select distinct connect_town from ean_publiek where connect_town like '%andvoort'; 
+-----------------+ 
| connect_town | 
+-----------------+ 
| EEXTERZANDVOORT | 
| ZANDVOORT  | 
+-----------------+ 
2 rows in set (24.16 sec) 


mysql> select distinct connect_town from ean_publiek where connect_town = 'zandvoort'; 
+--------------+ 
| connect_town | 
+--------------+ 
| ZANDVOORT | 
+--------------+ 
1 row in set (0.00 sec) 


mysql> select distinct connect_town from ean_publiek where connect_town like '%LOO OLDEBROEK'; 
+------------------+ 
| connect_town  | 
+------------------+ 
| 'T LOO OLDEBROEK | 
+------------------+ 
1 row in set (0.09 sec) 

私はこれを作っているわけではありません。これは家庭学習プロジェクトではありません。それは仕事のプロジェクトです。私は設定が必要な奇妙な設定だと思っています。印刷できない文字は表示されません。テストサーバーからエクスポートして作成したダンプファイルからインポートします。

+0

これは奇妙です。これらの結果は一致していますか?そして、あなたが 'distinct'(' select connect_town from ean_publiek where indication_special_connection = '1';)または条件( 'ean_publiekから' select distinct connect_town; ')を取り除いても、欠けているフロントエンド文字が得られますか? – lurker

+0

あなたの提案をうまく解決しました。編集のOPをご覧ください。 – HelpVampire666

+0

'' TOO OLDEBROEK'は実際には正しいですか?あなたはそのことについて何も言わなかった。 'select distinct connect_town from ean_publiekを試してみてください。ここでconnect_town = 'ZANDVOORT';'それは奇妙に見えますが、印刷できない文字をチェックしています。 (しかし、なぜ 'select * ...'が動作するのでしょうか?)これは 'ZANDVOORT'を表示するか、あるいは私が考えると思いません。 – lurker

答えて

1

は、my.iniのより高いメモリ設定を使用して解決されました(my.cnfと呼ばれる古い時代)。 MySqlはエラーログに1行ではなく、不平を言っていません。今まで私はあなたが幸運だったと思う。だから、私は愚かでした、私は(魔法のように魔法のように常に働く)と仮定し、間違っていると仮定したので、それは怠け者でした、そして、私は残念です。

関連する問題