Jump to content

Archived

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

iizzo

Query Question

Recommended Posts

Mysql help

I need help on a query, I\'m trying to get a report on orders that are new on an issue and orders that where in the older issue but not in the current one

 


ID	order_ID	issue_number

------------------------------------

1       1        555

2       1        556

3       2        555

4       1        557

5       2        556

6       2        557

6       1        558

I can\'t get it right Please help

I\'m using MySQL 4.0.13 PHP 4.2.3

Share this post


Link to post
Share on other sites

\"SELECT * FROM table_name WHERE issue_number != 555\";

 

Replace 555 with variable that holds the current issue_number.

 

\"SELECT * FROM table_name WHERE issue_numer != $current_issue\";

Share this post


Link to post
Share on other sites

one minor correction to that second query:

 

\"SELECT * FROM table_name WHERE issue_numer != \'$current_issue\'\";

Share this post


Link to post
Share on other sites

×

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.