MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old March 7th, 2005, 02:45 PM
maarten_m4 maarten_m4 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 2 maarten_m4 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 m 32 sec
Reputation Power: 0
Compare different values with each other

I have to compare different values with eachother, and then write them to a new table. I have the following tables
Table A
index (int)
valueA1 (int)
valueA2 (int)

Table B
index (int)
valueB1 (int)
valueB2 (int)

I need to find out if values B1 and B2 are bigger than valueA1 and smaller than valueA2. When this is the case I need to write valueB1 and valueB2 to another table. Is this possible with mySQL?

Reply With Quote
  #2  
Old March 8th, 2005, 06:11 AM
maarten_m4 maarten_m4 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 2 maarten_m4 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 m 32 sec
Reputation Power: 0
anybody?

Reply With Quote
  #3  
Old March 8th, 2005, 07:43 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 4 m 48 sec
Reputation Power: 8
I can offer programmatic ways to do this, but I'm not sure of a way to do this solely with MySQL

The other option would be to write a simple script [PHP?] to generate the SQL for you.

Reply With Quote
  #4  
Old March 8th, 2005, 11:36 AM
Madpawn Madpawn is offline
My beat is correct.
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 339 Madpawn User rank is Private First Class (20 - 50 Reputation Level)Madpawn User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 22 h 3 m 33 sec
Reputation Power: 4
I'm guessing it's possible, but you'd have to set up user-defined functions, so it'd be a lot of trouble, assuming you even have the privs for it.

I'd aim at a script solution, which would be much simpler to implement.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > Compare different values with each other


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway