Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Help with JOins

 
   Database Help (Home) -> MSEQ RSS
Next:  Large data warehouse load utilities  
Author Message
Farhan2

External


Since: Oct 13, 2004
Posts: 2



(Msg. 1) Posted: Thu Oct 16, 2008 11:11 am
Post subject: Help with JOins
Archived from groups: microsoft>public>sqlserver>mseq (more info?)

Hi,

I have these queries and i want to JOIN all of them to make one query.

Can anyone help me write this query

select mlc.*, invxf.*
From CommerceCenter..p21_view_inv_xref invxf left outer join
dbo.MikeLittle_Chevron mlc
on invxf.their_item_id=mlc.material
where delete_flag = 'N' AND
invxf.customer_id in
(66708, 70915, 67766, 71410, 67786, 87575, 88655)



select standard_cost as 'dxp cost',primary_supplier_id as 'supplier id'
from CommerceCenter..p21_view_inv_loc
where location_id=10002


select purchase_pricing_unit as 'oum'
from
CommerceCenter..p21_view_inv_mast



select name as 'supplier name'
from
CommerceCenter..p21_view_address
where name= 'supplier id'

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

I came this far when ran pulls the data

select mlc.* from pubs.dbo.MikeLittle_Chevron mlc
left join p21_view_inv_xref invxf on invxf.their_item_id = mlc.material and
invxf.customer_id = '66708'
left join CommerceCenter..p21_view_inv_loc il on invxf.inv_mast_uid =
il.inv_mast_uid and il.location_id = '10002'

 >> Stay informed about: Help with JOins 
Back to top
Login to vote
Hugo Kornelis

External


Since: Jan 11, 2008
Posts: 440



(Msg. 2) Posted: Fri Oct 17, 2008 7:26 pm
Post subject: Re: Help with JOins [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Thu, 16 Oct 2008 11:11:02 -0700, Farhan wrote:

>Hi,
>
>I have these queries and i want to JOIN all of them to make one query.
(snip)

Hi Farhan,

For questions such as these, the usual recommendation is to post the
following information:

* The structure of all tables involved in the problem. Please post as
CREATE TABLE statements, including all relevant columns, all
constraints, and all indexes.

* Some well-chosen rows of sample data to demonstrate the problem,
posted as INSERT statements.

* Expected results, and ideally a short description of the underlying
business logic.

See www.aspfaq.com/5006 for more information.

--
Hugo Kornelis, SQL Server MVP
My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis

 >> Stay informed about: Help with JOins 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
index on a view - Hello, I have a table (TAB) and A View with alias (VIEW) Table cod varchar 3 descr carchar 60 my view cod alias COd1 descr alias DES Now i need a index on view with key COD1 I can't create it. Can..

Creating an alias - I have an alias that can get very long because it maintains a information of where it came from. Is there a way to alias an alias? My first thought was: Declare @T1 varchar(128) Set T1 = 'MyAlias' .... Inner Join Table1 as @T1 This of course does no...

Formatting numeric fields in select-clause - This is propably a very simple question, but I can“t seem to find the answer to it in the documentation. I want to format a numeric field so the result is right justified and zero-filled. ex select 1 will give the result 01 How do I manage this..

Simple Query problem - Sample table as follows Order ID Stock Code Status --------- ------- ------- 203 STK1 3 203 STK2 2 203 STK4 3 204 STK1 3 204 STK5 3 205 ..

query assistance -return most recent date - I have a table that has two fields, pkg_num, which is a number, and del_date_time, which is a date-time. The table can contain duplicate pkg_num values, as long as the del_date_time values are different for any given number. I need a query that will...
   Database Help (Home) -> MSEQ All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]