[wellylug] more on sql script

E Chalaron e.chalaron at xtra.co.nz
Wed Nov 28 12:40:44 NZDT 2007


Hi there

Following my previous email regarding Mysql.
Thanks to your various replies I have found several commands to provide 
me with data in an ordered way.

I still have a problem. Some lines in the result are redundant.
It is probably a pitfall for beginners in Mysql but can't find a solution.

Here is my command (I am using the database from Streber a project 
management web interface):

select strebproject.name, strebtask.name, strebtask.date_closed, 
strebtask.time_released \
INTO OUTFILE '/data/data_test4.csv' FIELDS TERMINATED BY ',' ENCLOSED BY 
'"' LINES TERMINATED BY '\n' \
from strebtask inner join strebproject \
on strebtask.date_start = strebproject.date_start \
where strebtask.name="14 day update" \
order by strebproject.name asc;


and here is the result :
"test" appears several times and "Test Edouard" only once.. "test" 
should appear once as "Test Edouard"

RESULTS :

"test","14 day update","0000-00-00","0000-00-00 00:00:00"
"test","14 day update","0000-00-00","0000-00-00 00:00:00"
"test","14 day update","0000-00-00","0000-00-00 00:00:00"
"Test Edouard","14 day update","0000-00-00","0000-00-00 00:00:00"
"test file for dates","14 day update ","0000-00-00","0000-00-00 00:00:00"
"test file for dates","14 day update","0000-00-00","0000-00-00 00:00:00"


Thanks a lot for any help
E




More information about the wellylug mailing list