DATABASE MYSQL column automatic values calculated

Creating desktop or client-server database solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: DATABASE MYSQL column automatic values calculated

Post by mwieder » Thu Mar 15, 2012 12:49 am

Ah. OK - I see what you're trying to do now. What's the relationship between the two tables (how are they joined)?

poisonnnn
Posts: 13
Joined: Thu Mar 08, 2012 7:44 am

Re: DATABASE MYSQL column automatic values calculated

Post by poisonnnn » Thu Mar 15, 2012 6:44 am

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.

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: DATABASE MYSQL column automatic values calculated

Post by mwieder » Thu Mar 15, 2012 5:30 pm

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?

poisonnnn
Posts: 13
Joined: Thu Mar 08, 2012 7:44 am

Re: DATABASE MYSQL column automatic values calculated

Post by poisonnnn » Sat Mar 17, 2012 11:43 am

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 :/

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: DATABASE MYSQL column automatic values calculated

Post by Mark » Sat Mar 17, 2012 3:08 pm

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
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply