akdb | An experimental relational DBMS developed by students | Database library
kandi X-RAY | akdb Summary
kandi X-RAY | akdb Summary
An experimental relational DBMS developed by students @ Faculty of Organization and Informatics, University of Zagreb.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of akdb
akdb Key Features
akdb Examples and Code Snippets
Community Discussions
Trending Discussions on akdb
QUESTION
i'm using java with mysql,i have this code in mysql
SELECT DISTINCT date(datecreat) as datetemp
, (SELECT max(sensortemp) FROM akdb.iotdatas WHERE date(datecreat)=datetemp ) as maxt
, (SELECT min(sensortemp) FROM akdb.iotdatas WHERE date(datecreat)=datetemp ) as mint
, (SELECT avg(sensortemp) FROM akdb.iotdatas WHERE date(datecreat)=datetemp ) as avgt
, (SELECT max(sensorhum) FROM akdb.iotdatas WHERE date(datecreat)=datetemp ) as maxh
, (SELECT min(sensorhum) FROM akdb.iotdatas WHERE date(datecreat)=datetemp ) as minh
, (SELECT avg(sensorhum) FROM akdb.iotdatas WHERE date(datecreat)=datetemp ) as avgh
, (SELECT max(sensorpres) FROM akdb.iotdatas WHERE date(datecreat)=datetemp ) as maxp
, (SELECT min(sensorpres) FROM akdb.iotdatas WHERE date(datecreat)=datetemp ) as minp
, (SELECT avg(sensorpres) FROM akdb.iotdatas WHERE date(datecreat)=datetemp ) as avgp FROM akdb.iotdatas where (serialnum ='0000000000000');
the result is like this:
but i want to insert this data into other table using this code
insert into akdb.climdatas(hightemp,lowtemp,avgtemp,highhum,lowhum,avghum,highpress,lowpress,avgpress,dateinsert,zonedatas)values(maxt,mint,avgt,maxh,minh,avgh,maxp,minp,avgp,datetemp,'zone h');
here the problem is "maxt mint ..." are unknown, but if i use select into insert
insert into akdb.climdatas(SELECT DISTINCT date(datecreat) as datetemp
,(SELECT max(sensortemp) FROM akdb.iotdatas WHERE date(datecreat)=datetemp )
, (SELECT min(sensortemp) FROM akdb.iotdatas WHERE date(datecreat)=datetemp )
, (SELECT avg(sensortemp) FROM akdb.iotdatas WHERE date(datecreat)=datetemp )
, (SELECT max(sensorhum) FROM akdb.iotdatas WHERE date(datecreat)=datetemp )
, (SELECT min(sensorhum) FROM akdb.iotdatas WHERE date(datecreat)=datetemp )
, (SELECT avg(sensorhum) FROM akdb.iotdatas WHERE date(datecreat)=datetemp )
, (SELECT max(sensorpres) FROM akdb.iotdatas WHERE date(datecreat)=datetemp )
, (SELECT min(sensorpres) FROM akdb.iotdatas WHERE date(datecreat)=datetemp )
, (SELECT avg(sensorpres) FROM akdb.iotdatas WHERE date(datecreat)=datetemp ),' zone h'FROM akdb.iotdatas where (serialnum ='0000000000000000'))
the error is in the columns "mysql column count doesn't match value count at row 1"
...ANSWER
Answered 2017-Jun-22 at 05:45Seems like you have more or less than 11 columns in climdatas
table. In your insert statement, specify list of columns separated by comma
.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install akdb
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page