Jump to content

SQL noob: ANY and IN hmmm.


jamkelvl

Recommended Posts

:shrug:

 

Okay, so this is my current select statment...

 

<?php
// all other code omitted
$select = "SELECT * FROM jobs WHERE work_order_number = '' && ship_to != 'Tatry Non Profit Housing Corp.' ORDER BY ship_to, unit_number";
?>

 

What I want to do is also check if work_order_number is equal to ANY po_number IN another tabled called pos. So like...

 

<?php
// all other code omitted
$select = "SELECT * FROM jobs WHERE work_order_number = '' OR work_order_number = ANY(SELECT * po_number FROM pos) && ship_to != 'Tatry Non Profit Housing Corp.' ORDER BY ship_to, unit_number";
?>

 

Any help?

Link to comment
https://forums.phpfreaks.com/topic/194804-sql-noob-any-and-in-hmmm/
Share on other sites

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.