Page 2 of 2
Re: DATABASE MYSQL column automatic values calculated
Posted: Thu Mar 15, 2012 12:49 am
by mwieder
Ah. OK - I see what you're trying to do now. What's the relationship between the two tables (how are they joined)?
Re: DATABASE MYSQL column automatic values calculated
Posted: Thu Mar 15, 2012 6:44 am
by poisonnnn
What do you mean joined? Thats's the question, how to get data in the same query from other table which will form the data in a query from table 1. Tables are in the same DataBase.
Re: DATABASE MYSQL column automatic values calculated
Posted: Thu Mar 15, 2012 5:30 pm
by mwieder
OK - it sounds like you need to do more research into relational databases before you're ready to tackle this problem.
http://docs.oracle.com/javase/tutorial/ ... abase.html
https://www.youtube.com/watch?v=jyklg0cTN3M
Let's look at it a different way: what end result are you looking for? What are you trying to do?
Re: DATABASE MYSQL column automatic values calculated
Posted: Sat Mar 17, 2012 11:43 am
by poisonnnn
I'm trying to do:
how to use data from other table in the same query for filtering:
SELECT A, B ,C, (SELECT D FROM TABLE2 WHERE C[from table2] < B[from table1]) FROM TABLE1; <-- the stucture of query
help :/
Re: DATABASE MYSQL column automatic values calculated
Posted: Sat Mar 17, 2012 3:08 pm
by Mark
Hi,
You really should install a MySQL database manager (phpMyAdmin suffices) and experiment a little. For example, see what happens if you create a database with 2 tables and join the tables. I have put a simple example on
my blog.
Kind regards,
Mark