Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

SQL Question

$
0
0

So i can't seem to figure this out. We have a SQL database that runs an application that we purchased from an external vendor, and occasionally i am asked to see if i can run SQL reports that i can export to a PHP report for someone to access easily. I am trying to see if how to do the following in SQL.

We have 1 table where a bunch of data just dumps, if can be either purchase amounts, quantity numbers, users, etc. However when a user dumps into this filed it shows it as a User ID. So i want do do the following.

I want It to conditionally check if an item in the value field matches an item in the users table, then show the users name rather than the ID. However if no match is found display the original value.

Thanks in advance for any help.


Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>