![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I need some help here with a multi-table join. I am writing a stored procedure with a code block that needs to join my service table, my product table, and my #tmp table (used to sort categories) - returning all product names and service names that satisfy a keyword string as one column and another (related column) to designate the item type (product or service). so, in pseudo(ish) code, something to the effect: create table #tmp(names, type); select servicename & productname as names (product or service) as type from service s, product p, #temp t where s.categoryid = t.catid and t.catid = p.categoryid and freetext(s.servicename, @UsrKeywords) and freetext(p.productname, @UsrKeywords); I know the above is bad SQL but I hope it gives you a rough idea of what I am trying to do. Also, there is no column designating "product or service" but I am wondering if it is possible to itemize the type column based on what column the "names" data is being pulled from? |
![]() |
| Thread Tools | |
| Display Modes | |
| |