Wednesday, 15 June 2011

select - Not able to retrieve data from mysql with string matching -



select - Not able to retrieve data from mysql with string matching -

mysql> select * friends limit 10; +----+------------------------+-------------------------+ | id | user | fri | +----+------------------------+-------------------------+ |mhl_bkfgq | null | 2 | mwhr9lvodrbqtu1i_drfbg | 8y2en4xnnhnwssupb31sjg | 3 | mwhr9lvodrbqtu1i_drfbg | a1jplej99kxz3t9wq3np-g | 4 | mwhr9lvodrbqtu1i_drfbg | resyioogkqg6q0qgtj_1ga | 5 | mwhr9lvodrbqtu1i_drfbg | skl1onkjmqd4gdfpvhu88q | 6 | mwhr9lvodrbqtu1i_drfbg | 3ss2aqrsoo7wbxe2gcllfq | 7 | mwhr9lvodrbqtu1i_drfbg | sgy3jdbhtzdttbo7unqqxg | 8 | mwhr9lvodrbqtu1i_drfbg | aez4y1f0m2ucifmfzpzfjw | 9 | mwhr9lvodrbqtu1i_drfbg | ft4jx_9crwykfroxv_mirw |10 | mwhr9lvodrbqtu1i_drfbg | qmzoaym7itbtdktn6ay_ag +----+------------------------+-------------------------+ 10 rows in set (0.00 sec)

command:

mysql> select * friends fri="3ss2aqrsoo7wbxe2gcllfq";

result:

empty set (0.37 sec)

this beyond understanding. there valid info in above table when seek retrieve it, shows no rows.

details of table:

create table friends ( id int not null, user varchar(100) not null , fri varchar(100) , primary key (id) )engine=myisam;

i got issue. have loaded file next command:

load info local infile 'file.txt' table friends fields terminated ',' lines terminated '\n';

but lastly column has ending '\r\n'. so, \r garbage invisible. when clean file removing \r using python, sql works expected. give thanks guys support.

mysql select

No comments:

Post a Comment