Hi Group, I am trying to answer this question: Get the aids and anames of agents with maximum percent who place orders for all products ordered by customer...
Hi, There was a certain requirement in a application that the database language for the user (DB credentials) should be <British English>; to check that I used...
Dear all I am really new to complex sql query I need help to find another possibilities for this query there's so many subquery to skala_rental table Ho to...
Hi Guys, I have a table ENCHANGE_RATES with columns: CURRENCY_CODE varchar(3) EFFECTIVE_FROM datetime EFFECTIVE_TO datetime RATE decimal(22,8) suppose I have...
Hi Noman I thought I would attempt a quick answer. What you need to do is get the Max(Date) less than or equal to the date requested. (It might be an issue if...
Hello, I have a table with item and description like below Item Description 1234a Tool A 1234b Null 1234c Null 2345a Item B 2345b Null 2345c Null How...
Hello, I have a table with item and description like below Item Description 1234a Tool A 1234b Null 1234c Null 2345a Item B 2345b Null 2345c Null How...
I am getting What I need to get, what I further what is to merge it into a single query. "Max(Date) less than or equal to the date " is just half of my...
Is the pattern of Item numbers consistent, A always has a the valid description and A is always followed by b and c but not d e f ... ? John Warner ... 19000 ...
John Warner
john@...
Oct 16, 2009 7:16 pm
4340
Also, always 4 digits? And is this a one time query or does this need to be repeated on a regular? Haven't time right now (Friday) but will noodle out...
John Warner
john@...
Oct 16, 2009 7:23 pm
4341
update OriginalTable set Description = TableWithCorrectDescription.Description from Table OriginalTable, Table TableWithCorrectDescription where substr(1,4,...
no i fixed it by creating a table with unique item numbers and descriptions and then running an update to set the description to the unique description on a...
REMATCH2: I left out the non-null requirement for instance t2. ..sorry. Here it is again: update Table t set t.description= t2.description from Table t,...
BTW, it is always good practice to test your update query with a select of which rows are going to be affected by the update... here is what i do: I highlight...
THE FINAL UPDATE STATEMENT... see, that this resolves your problem... Sometimes, it takes multiple tries.... update Table t set t.description= t2.description ...
Actually it should have been the "_" underscore. I only wanted to match a single character. The '%' character matches zero or more characters. But you are...
John Warner
john@...
Oct 17, 2009 3:05 pm
4350
Why is all_degrees null when degree2 is null? what am i missing? it only works if degree2 is not null I want DEGREE1, DEGREE2 (if not null) select...
I think you'll have to check Is NULL and not just NULL try this way select degree1,degree2, (case when degree2 IS NULL then degree1 else degree1+', '+degree2...
SELECT degree1, degree2, (CASE WHEN degree2 IS NULL THEN degree1 ELSE degree1 + ', ' + degree2 END) AS all_degrees FROM fac_facultytbl GROUP BY degree1, ...
John Warner
john@...
Nov 5, 2009 7:57 pm
4356
I don't have any instance of SQL server to check the query. But as far as I can recollect the syntax it should work....