October 26, 2010 at 7:45 am
ORDER BY CAST(WEEKNAME AS DATETIME), SUM(QUANTITY) DESC
October 26, 2010 at 7:49 am
I can't tell what you're asking. Can you clarify your question?
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
October 26, 2010 at 7:52 am
the code i have now gives me few items but i want all the items
October 26, 2010 at 7:53 am
If by "all the items" you mean you want all the rows in a table, you can get that most easily by not having a Where clause at all. That will give you all the rows.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
October 26, 2010 at 7:57 am
i tried using select but it didnt work i didnt get what you meen actualy
October 26, 2010 at 7:59 am
Your question isn't all that clear.
Do you want all the rows in a table?
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
October 26, 2010 at 8:01 am
if yes , what is your approach
October 26, 2010 at 8:03 am
If yes, don't have a Where clause.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
October 26, 2010 at 8:06 am
so what sould i replace with where claus, there should be some clouse right
October 26, 2010 at 8:17 am
If you want every single row in the table, take the where clause out completely. It's optional, doesn't have to be there.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
October 26, 2010 at 8:25 am
If you absolutely insist on having a Where clause, but want all the rows, use:
Where 1 = 1
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
October 26, 2010 at 8:30 am
i keep getting this error
October 26, 2010 at 8:30 am
i keep getting this error
October 26, 2010 at 8:31 am
The error is meaningless without the query. Can't help without that.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
October 26, 2010 at 8:36 am
harita (10/26/2010)
Hi, allthe code i have now selects only selected itemname but i want to select all he items can some change the code- thanks
WHERE IT.ITEMNAME IN ('xxx','xxx','xxx','xxx','xxx','xxx') AND
If you feel better with a WHERE clause in your query then write it like this:
WHERE 1 = 1 AND ...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
Viewing 15 posts - 1 through 15 (of 16 total)
You must be logged in to reply to this topic. Login to reply