query

AdvantureWorks Hirarchy

Hi everybody. I have a question about AdvantureWorks. What is the query to determine the full hirarchy of an employee's managers? example: Alex is the input Sara (Manager - Level 1) James(Manager - Level 2) David(Manager - Level 3) Alex(Simple Employee) ...

MySQL Cast NULL to integer 0

Hello. How can I cast something that returns NULL to 0? If this is my query: select col from table; would this be the right way to do it: select cast(col as unsigned integer) from table;? Thank you. ...

PHP - Database query or POST

I have a search page that allows the users to filter other users by various categories (age, gender, country, region, ethnicity, etc). The first time the search function is called it gets all the possible values for each category from the database. Just wondering though... Is it better to POST this data back each time the page is re-loa...