Win Surprise Gifts!!!
Top 5 Contributors of the Month
Post New Question
Subscribe to Forum
Sql query for hiding products which r in inactive groups
April 13, 2011
My requirement is . I have productGroup table which contains mainly productGroupId, ParentProductGroupId, Active colums. where i can set parent product groupid.
The second table is product table where i can specify productgroup of the product.
Now one product group in active then the products in that group shouldn't come in select statement. not only product group parent product group of that group also.
how to write query please help me.
Product Group Table
GroupId ParentGroupId Active
1001 Null true ->this is parent group
1002 1001 true ->Child of 1001
1003 1002 false ->child of 1002
like this i can create no of groups
if 1001 group is inactive the in select no products should come.
if 1001 is active and 1002 is inactive then 102 and 103 shouldn't come and 101 should come.
Posted Date: September 29, 2011 Points: 20
Please refer this site..it may be useful
Regards, Lakshmi Naraayanan.S
To post reply
Related Questions Related Questions
query handling in asp
Having a doubt in SQL query
How to write query
what is the maximum length of a query string?
How to get records from n to m using MYSQL Query
How to get records from start date and end date of the month using MYSQL Query
error in the sql query
Query not being executed
Latest Forum Questions From The Same Category
Help to get SQL output
how to restore my sql database from my hosting provider?
SQL query to update date range
Add allowance to employee table is wrong or true according to my case
how to remove trailing zeroes in a decimal in sql server
Required Union All Result in two different column
Sql Multiple table data retrival
Table Translation records
How select huge Data from sql without take long time?
Passing using parameter in store procedure get the top3 record from the table
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more
Quick Links For Forum Categories:
Hall of Fame
Terms of Service
Tell A Friend