Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Can anyone please help with a JOIN?


Jamez

Recommended Posts

Hi,

There are 3 very similar queries in our store that im sure can be made into one with a JOIN although im not sure how to implement it.

 

[3] => SELECT cache_expires FROM cache WHERE cache_id='9e18319fdade9c4245b75b9845486bb8' AND cache_language_id='1' LIMIT 1

[4] => SELECT cache_expires FROM cache WHERE cache_id='dae46d252d93631f218b79dd62eb04eb' AND cache_language_id='1' LIMIT 1

[5] => SELECT cache_expires FROM cache WHERE cache_id='f47315cba5e35ca49994fbf925cfaa75' AND cache_language_id='1' LIMIT 1

 

These are the 3 queries from Chemo`s Page Cache contribution.

Any help making this into 1 query would be great!

Thanks in advance.

Link to comment
Share on other sites

Hi,

There are 3 very similar queries in our store that im sure can be made into one with a JOIN although im not sure how to implement it.

 

[3] => SELECT cache_expires FROM cache WHERE cache_id='9e18319fdade9c4245b75b9845486bb8' AND cache_language_id='1' LIMIT 1

[4] => SELECT cache_expires FROM cache WHERE cache_id='dae46d252d93631f218b79dd62eb04eb' AND cache_language_id='1' LIMIT 1

[5] => SELECT cache_expires FROM cache WHERE cache_id='f47315cba5e35ca49994fbf925cfaa75' AND cache_language_id='1' LIMIT 1

 

These are the 3 queries from Chemo`s Page Cache contribution.

Any help making this into 1 query would be great!

Thanks in advance.

 

They can be made into one, but a join is completely unnecessary. However, I wonder if this will continue to work as you expect when you combine the queries.

 

SELECT cache_expires FROM cache WHERE ( cache_id='9e18319fdade9c4245b75b9845486bb8' OR cache_id='dae46d252d93631f218b79dd62eb04eb' OR cache_id='f47315cba5e35ca49994fbf925cfaa75' ) AND cache_language_id='1' LIMIT 3

Contributions

 

Discount Coupon Codes

Donations

Link to comment
Share on other sites

They can be made into one, but a join is completely unnecessary. However, I wonder if this will continue to work as you expect when you combine the queries.

 

SELECT cache_expires FROM cache WHERE ( cache_id='9e18319fdade9c4245b75b9845486bb8' OR cache_id='dae46d252d93631f218b79dd62eb04eb' OR cache_id='f47315cba5e35ca49994fbf925cfaa75' ) AND cache_language_id='1' LIMIT 3

 

Interesting,

I wonder why there are 3 cache files in the first place?

Surely only 1 is required?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...