Viewing 15 posts - 706 through 720 (of 1,183 total)
Nadeem Shafi (12/3/2007)
select orderdetails.orderid,...
December 3, 2007 at 6:36 am
Provided all of your return columns are of the same dataType, and I assume from their names they are. this will return the column depending on the parameter value passed...
December 3, 2007 at 5:45 am
Ok, what are the conditions for MYCOLUMN and what should/will be returned...
I mean, is it something like if a "1" is passed the first column is returned, "2" the second...
December 3, 2007 at 5:28 am
NO.... you won't have to replicate it.
Post it here and I'll show you....
December 3, 2007 at 5:18 am
duncan.williams (12/3/2007)
1) I didn't design the table - I am stuck with it!
2) I don't want to use dynamic SQL
3) Do I really have to do this 15 times in...
December 3, 2007 at 5:10 am
Provided each order detail has an entry in the products table, this will work.
SELECT
orders.orderid
,orders.orderdate
,orderdetails.productid
,laborderstatus.initialduedate
...
December 3, 2007 at 5:08 am
Jeff Moden (11/30/2007)
Heh... at that point... I'd be thinking "BEER"! 😀
It's about time you starting talking my language. Well, second language. :w00t:
November 30, 2007 at 3:52 pm
This is just a possible solution, but what if you aliased your table names? Like "table1 as a", "table2 as b". Could you work that into your solution by then...
November 30, 2007 at 5:20 am
or this might help ...
Move the sub query outside of the CTE definition.
WITH GetAllCategories
AS (SELECT
ROW_NUMBER() OVER (ORDER BY [Name] ASC)...
November 30, 2007 at 5:04 am
Jeff Moden (11/29/2007)
I appologize ahead of time for the layout of my code on this page.
Heh... if you took 5 minutes out ahead of time to fix it, you...
November 30, 2007 at 4:52 am
Jeff, Matt and whomever else is reading this ....
I think all that happened here is something that I KNOW I have been guilty of ... "Answering a question without really...
November 30, 2007 at 4:49 am
Well if you're select a bunch of data and only the first name needs to be random for EACH record inserted. then change my query to read "TOP 1".
Otherwise, you'll...
November 29, 2007 at 5:00 pm
jreed,
It's difficult to really optimize the query without test data/tables, but here goes ...
First, I reformatted it a bit for ease of reading (at least for me).
Second, remove the DISTINCT...
November 29, 2007 at 4:40 pm
Viewing 15 posts - 706 through 720 (of 1,183 total)