Hi everyone, I'm kind of new to more advanced sql than update,select, etc. and I'm trying to select all records from one table, modifying the returned value of a field on some of them based on records from another table. Basically, I have a customers table and an orders one, trying to select all customers from customer, but add an (A) at the beginning of the customer name in the results for those who have an entry in the orders table (A for active).
Here is my select statement for getting all customers:
SELECT * FROM Customers WHERE cust_name LIKE '$queryString%'
and here is how I get their orders
SELECT * FROM Orders WHERE order_cust = '$customer' ORDER BY order_date DESC
I'm extremely hazy on joins, and I intend to un-haze soon, but would like to churn this out fast for a friend's site.
Thanks
Here is my select statement for getting all customers:
SELECT * FROM Customers WHERE cust_name LIKE '$queryString%'
and here is how I get their orders
SELECT * FROM Orders WHERE order_cust = '$customer' ORDER BY order_date DESC
I'm extremely hazy on joins, and I intend to un-haze soon, but would like to churn this out fast for a friend's site.
Thanks