Help Creating SQL view to join product name and version name

Posted By saturation Tue 15 Mar 2011
Add to Favorites0
Author Message
saturation
 Posted Tue 15 Mar 2011
Supreme Being

Supreme Being - (64,866 reputation)Supreme Being - (64,866 reputation)Supreme Being - (64,866 reputation)Supreme Being - (64,866 reputation)Supreme Being - (64,866 reputation)Supreme Being - (64,866 reputation)Supreme Being - (64,866 reputation)Supreme Being - (64,866 reputation)Supreme Being - (64,866 reputation)

Group: Forum Members
Last Active: Fri 30 Nov 2012
Posts: 108, Visits: 1,185
I need to create a SQL view that shows the name of the product in one column, each of the version names for each product in the next, and then each of the attributes as columns after the version.   I'm not sure how to join the product and version tables with the tblKartrisLanguageElements--it's a little confusing.  

Can anyone help?
Mohammad
 Posted Wed 16 Mar 2011
Kartris Expert

Kartris Expert - (78,823 reputation)Kartris Expert - (78,823 reputation)Kartris Expert - (78,823 reputation)Kartris Expert - (78,823 reputation)Kartris Expert - (78,823 reputation)Kartris Expert - (78,823 reputation)Kartris Expert - (78,823 reputation)Kartris Expert - (78,823 reputation)Kartris Expert - (78,823 reputation)

Group: Administrators
Last Active: Sun 27 Sep 2015
Posts: 115, Visits: 706

Try this one:


SELECT  vKartrisProductsVersions.P_Name, vKartrisProductsVersions.V_Name,
              vKartrisTypeAttributes.ATTRIB_Name, vKartrisTypeAttributeValues.ATTRIBV_Value
FROM     vKartrisTypeAttributeValues INNER JOIN  vKartrisTypeAttributes ON
              vKartrisTypeAttributeValues.ATTRIBV_AttributeID = vKartrisTypeAttributes.ATTRIB_ID
              INNER JOIN vKartrisProductsVersions ON vKartrisTypeAttributes.LANG_ID =
              vKartrisProductsVersions.LANG_ID AND
              vKartrisTypeAttributeValues.ATTRIBV_ProductID = vKartrisProductsVersions.P_ID
saturation
 Posted Thu 17 Mar 2011
Supreme Being

Supreme Being - (64,866 reputation)Supreme Being - (64,866 reputation)Supreme Being - (64,866 reputation)Supreme Being - (64,866 reputation)Supreme Being - (64,866 reputation)Supreme Being - (64,866 reputation)Supreme Being - (64,866 reputation)Supreme Being - (64,866 reputation)Supreme Being - (64,866 reputation)

Group: Forum Members
Last Active: Fri 30 Nov 2012
Posts: 108, Visits: 1,185
Thanks, Mohammad.   That helped.

How do the product and version tables actually join with the language elements table?   I can't seem to figure it out--I'm trying to create my own custom view and would like only the necessary fields joined together rather than joining SQL views with other SQL views that bloat the view I'm trying to use.

Any help is appreciated.
Mohammad
 Posted Fri 18 Mar 2011
Kartris Expert

Kartris Expert - (78,823 reputation)Kartris Expert - (78,823 reputation)Kartris Expert - (78,823 reputation)Kartris Expert - (78,823 reputation)Kartris Expert - (78,823 reputation)Kartris Expert - (78,823 reputation)Kartris Expert - (78,823 reputation)Kartris Expert - (78,823 reputation)Kartris Expert - (78,823 reputation)

Group: Administrators
Last Active: Sun 27 Sep 2015
Posts: 115, Visits: 706
Hi.

You can study the views that are prefixed by vKartrisType like:
vKartrisTypeCategories, vKartrisTypeProducts, vKartrisTypeVersions .. etc.

All those views contain the join of language elements table with a language element type table(products, categories, attributes, versions, news ..etc), so you can for example export Create View SQL Script for any of those views, then change the name of the view and select the needed fields.
saturation
 Posted Sat 19 Mar 2011
Supreme Being

Supreme Being - (64,866 reputation)Supreme Being - (64,866 reputation)Supreme Being - (64,866 reputation)Supreme Being - (64,866 reputation)Supreme Being - (64,866 reputation)Supreme Being - (64,866 reputation)Supreme Being - (64,866 reputation)Supreme Being - (64,866 reputation)Supreme Being - (64,866 reputation)

Group: Forum Members
Last Active: Fri 30 Nov 2012
Posts: 108, Visits: 1,185
Thanks!   That definitely helped me out.

Similar Topics

Expand / Collapse

Reading This Topic

Expand / Collapse

Back To Top