| | |
Sql Sort Query....
Please support our MS SQL advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: May 2008
Posts: 2
Reputation:
Solved Threads: 0
Ok, I have a e-commerce store that uses stored procedures to sort products. I have figured out how to sort my name and price but am having trouble sorting by rating bc the rating table doesnt have all the productids (only ones that have a rating) and also the rating table is in a different table than the products table so when I use the code below it only shows products that have a rating. Heres an example http://www.tunerplaza.com/c-304-carburetion.aspx?
Heres the sql code For the rating....
Heres the sql code For the rating....
MS SQL Syntax (Toggle Plain Text)
ELSE IF @sortEntityName = 5 BEGIN --Sort By Rating INSERT #RowNumber (rating) SELECT RT.Productid FROM Rating RT GROUP BY RT.ProductID ORDER BY MIN(RT.Rating) INSERT #displayorder select rating, displayorder from #RowNumber END
Last edited by tytyguy; May 4th, 2008 at 7:26 pm.
![]() |
Similar Threads
- sql query problem with MS Access and C# (C#)
- desperate for password protection (PHP)
- Undifined Index in PHP code (PHP)
- ASP- SQL Server..Query help.... (ASP)
- PHP Form, SQL connectivity issues, please help. (MySQL)
- problem with autogenerated mysql query (MySQL)
- calling a SQL UDF? (PHP)
- MySQL Maestro (Computer Science)
- Database Design (PHP)
- sort on field names; refresh page? (PHP)
Other Threads in the MS SQL Forum
| Thread Tools | Search this Thread |
Tag cloud for MS SQL
"last autogrowth business connectingtodatabaseinuse count cursor data database dateadd datepart day" dbsize deadlock delete_trigger getdate highperformancecomputing hpc hpcserver2008 ibm iis limit loop maximum microsoft ms mssql multiple multithreading news number permission position query reporting result server services sets single source sql sqlserver sqlserver2005 subtype supercomputing supertype tables uniqueid update view weekday





