Hello to everyone.
I am new in the forum, and my first post is going to be about mySQL. I am a total novice in mySQL and the problem i have is that i want to put a specific filter in reading some data.
I have created a database with one table, which has 4 columns, let's say C1, C2, C3, C4.
I have created the interface in java, through which the data is inserted in the dbase.
String insertStr =
"INSERT INTO `"+dbName+"`.`"+tableName+"` VALUES (CURRENT_TIMESTAMP , '"+
m.get_C1() + "', '" +
m.get_C2()+"', '"+
m.get_C3()+"', '"+
m.get_C4()+"');";
stmt.executeUpdate(insertStr);
Now, i want to start reading the data, in a specific way:
I want to read the C1,2,3,4 data of the line in which has C1=1 and the C2 is the maximum. Actually, i want to know C3,4 of this line through this filter.
the SELECT i am going to make is of that type:
String selectStr=
SELECT data1, data2, data3 FROM 'dbName'
The problem is how i am going to put a filter in this.
Also, is there a spexific code through which i can assign the data in java to some values?
Sorry if my long post was tiring, i hope somebody can give some help.
Thanks in advance,
Xaris