Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Yonkouturko
Yak Posting Veteran
59 Posts |
Posted - 2013-01-05 : 08:41:27
|
SELECT Qty, Category, Description, Tpc_Price, Srp, Visibility, Low, Average, HighFROM Table_TPC_POSTINGORDER BY CategoryUNIONSELECT Qty, Category, Description, Tpc_Price, Srp, Visibility, Low, Average, HighFROM Table_TPC_POSTINGORDER BY Descriptionim getting error like this" Column 'Table_TPC_POSTING.Qty' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause. "i really don't understand right now sql Errors.. because im still new at this... PLEASE HELP ME... |
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2013-01-05 : 16:14:44
|
Just get rid of the first order bySELECT Qty, Category, Description, Tpc_Price, Srp, Visibility, Low, Average, HighFROM Table_TPC_POSTINGORDER BY CategoryUNIONSELECT Qty, Category, Description, Tpc_Price, Srp, Visibility, Low, Average, HighFROM Table_TPC_POSTINGORDER BY DescriptionPost your full query if this doesn't solve the issue.JimEveryday I learn something that somebody else already knew |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-01-06 : 10:32:01
|
hmm? whats the purpose of above two queries? they look same to me------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
Yonkouturko
Yak Posting Veteran
59 Posts |
Posted - 2013-01-06 : 20:57:47
|
ahhh here are some of the data of Column CATEGORY and DESCRIPTIONCategory DescriptionHARDDISK HardDisk 80GB IDE Desktop Seagate SPMONITOR 15"LCD SP ASSORTEDMONITOR 17"LCD surplus ASSORTEDMONITOR 17"LCD surplus (Black)MONITOR 17"LCD SAMSUNG SYNCMASTER SPMONITOR 19"LCD SP ASSORTEDMONITOR 22"LCD SP ASSORTEDHARDDISK HardDisk 250 GB IDE SP Desktop SeagateHARDDISK HardDisk 250 GB SATA BN Desktop SeagateHARDDISK HardDisk 500 GB SATA Desktop (SURPLUS)CASING PISONET CASING ONLY w/ out accessoriesCASING PISONET CASING with accessoriesVIDEO CARD VIDEO CARD 1 GB MANLI GEFORCE210 DDR3 64BIT PCI-ECABLE UTP CABLE GRAY (Brand New)MOTHERBOARD MOTHERBAORD (FOR AMD) MOBO AM2 w/ build-in VIDEO SPHARDDISK HardDisk 40 GB IDE SP Desktop SeagateCASING HIP MINI w/ PSU HFI-5RMEMORY Memory 4 GB DDR3 SODIMM 1333 BN KingstonMONITOR 15"LCD SURPLUS (Black)MONITOR 15.6"LED AOC (Brand new)MONITOR 19"LCD SP ASSORTED2MONITOR 22"LCD SP ASSORTED1MONITOR 22"LCD SP ASSORTED2CASING CASING HIP MINI w/out PSU HFI-5R BNMONITOR 17"LCD wide surplusMONITOR 19"LCD SP ASSORTED3MONITOR 19"LCD SP ASSORTED1MONITOR 19"LCD SP ASSORTED4HARDDISK HardDisk 80GB sata Desktop Seagate SPHARDDISK HardDisk 320 GB SATA SP Desktop SeagateNOW IF POSSIBLE... I WANT TO ALPHABETIZE EACH COLUMN..THATS WHY i order each COLUMN and UNION them.....PLease HELP ME OUT!!!THANK YOU!!!! |
|
|
Yonkouturko
Yak Posting Veteran
59 Posts |
Posted - 2013-01-07 : 00:23:02
|
@VISAKHi've figured Out my problem... but still thanks for your support!!!i really appreciate all the learning !! :Dhere's my sqlSELECT Qty, Category, Description, Tpc_Price, Srp, Visibility, Low, Average, HighFROM Table_TPC_POSTINGORDER BY Category, Descriptioni really thought that i cudn't ORDER BY 2 fields at the same time...silly me.. hahaha |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-01-07 : 10:13:02
|
ok...now it makes sense ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|
|
|