I have created table in mysql with 12 fields
Field1Field2 Field3 Field4
Field12
I have an excel sheet with 12 columns and 150 rows.
My question is how can I import all of the columns from the excel sheet to my
table without losing any information.
Hi, sam
You can try to export table to file from Excel in CSV format.
And then import data from this file to mysql.
Something like this should help you:
LOAD DATA INFILE 'yourtabledata.txt' INTO TABLE yourtable FIELDS
TERMINATED BY ',' ENCLOSED BY '' LINES TERMINATED BY '\r\n';
sam rumaizan
I have a query that looks something like this:
SELECT (c_o_w_inst_rev - c_o_w_estcost)/c_o_w_inst_rev
FROM tmpGovernmentSummaries
The problem is that sometimes c_o_w_inst_rev is 0 and dividing by zero
returns a NULL.
If c_o_w_inst_rev == 0 how can I return 0 for the SELECT above instead
of
John Kopanas wrote:
I have a query that looks something like this:
SELECT (c_o_w_inst_rev - c_o_w_estcost)/c_o_w_inst_rev
FROM tmpGovernmentSummaries
The problem is that sometimes c_o_w_inst_rev is 0 and dividing by zero
returns a NULL.
If c_o_w_inst_rev == 0 how can I return 0 for the SELECT
Hello,
I have a table with this values:
idvaluetime
112200704042112
212200704042120
314200704042125
414200704042131
517200704042140
614200704042143
720200704042145
820200704042148
I want to
Vicente,
A simple fast way is via an exclusion join:
delete t1
from tbl t1
left join tbl t2 on t1.value=t2.value and t1.idt2.id
where t2.id is not null;
To understand how that works, notice that the query
select t1.id
from tbl t1
left join tbl t2 on t1.value=t2.value and t1.idt2.id
where
Well, maybe you want to read up on isnull() and case (..) in the manual.
It's in there, somewhere.
mysql SELECT CASE 1 WHEN 1 THEN 'one'
- WHEN 2 THEN 'two' ELSE 'more' END;
- 'one'
mysql SELECT CASE WHEN 10 THEN 'true' ELSE 'false' END;
- 'true'
mysql SELECT CASE BINARY