Viewing 15 posts - 1 through 15 (of 19 total)
AMIT -
That got me what I needed - thank you so much!
February 10, 2006 at 8:25 am
Thank you but this does not work, it will only bring back the name_col with the max rev_no - 'ABC'.
I want all name_col's for the key_col ('XYZ') and their max...
February 9, 2006 at 9:41 pm
Hope this helps - thank you...
BL_TRUCK_BOL_DEST_COMM_ORDER specifies how much of a commodity has been order by a specific order. BL_TRUCK_BOL_DEST_COMM specifies the total amount of product the destination plans to...
October 12, 2005 at 10:20 am
TABLE_B has a column (order_no) which is not contained on TABLE_A. Or, maybe it's better for me to...
SELECT TABLE_A.col_a, TABLE_A.col_b, TABLE_A.col_c,
col_d = (SELECT col_d FROM _B ...)
FROM TABLE_A
October 12, 2005 at 9:58 am
Since I am using the 'computed' columns as just placeholders to make the UNION work, I always want to use the values from the 'REAL' columns. So I woulkd want...
October 12, 2005 at 9:46 am
col_c does not exist in TABLE_B - I'm just using it as a placeholder for the UNION. What can I do to get 1 row?
October 12, 2005 at 9:31 am
Here's an example of my data
bol_no.....dest_bol_no
00001.....2BT
00001....1BT
.............4BT
.............5BT
If I give it @bol = 00001 - I want back 2BT & 1BT
If I give it @bol = '',@dest_bol = '4BT' - I want...
August 9, 2005 at 2:16 pm
If I do that:
SELECT *
FROM BL_TRUCK_BOL_DEST
WHERE bol_no = ''
union
SELECT *
FROM BL_TRUCK_BOL_DEST
WHERE bol_no = ''
and dest_bol_no = '2BT'
union
SELECT *
FROM BL_TRUCK_BOL_DEST
WHERE bol_no is NULL
and dest_bol_no =...
August 9, 2005 at 2:05 pm
GOVINN -
That worked great. I had to add a where clause though. Thank you very much - it really helped me out.
UPDATE A
SET
max_rev_yorn = 'Y'
FROM
BL_TRUCK_BOL_DEST A
JOIN
(SELECT bol_no, dest_bol_no, MAX(rev_no)...
August 8, 2005 at 3:33 pm
That doesn't work. Here's what it produces:
dest_bol_no...rev_no...max_rev_yorn
000002BT 32 .......Y
000003BT 32 .......Y
000004BT 8 ........
000005BT 10 ........
000006BT 32 ......Y
4BT & 5BT don't get updated.
August 8, 2005 at 3:00 pm
Here's my update:
UPDATE BL_TRUCK_BOL_DEST
Set max_rev_yorn = 'Y' WHERE rev_no in
(select rev_no from BL_TRUCK_BOL_DEST A
WHERE bol_no = '000001'
AND rev_no = (select max(rev_no) from BL_TRUCK_BOL_DEST B
where A.dest_bol_no = B.dest_bol_no))
AND
dest_bol_no in...
August 8, 2005 at 2:33 pm
Table 1 has some more values that I need in my result set that I didn't show.
Table 1
col_1.......col_2
1000......ABC
Table 2
col_1.....code.....value
1000......M........200
1000......R.........300
1000......X........350
I want
col_1.......col_2.....code.....value
1000......ABC........M..........200
1000......ABC........R..........300
But I want 1 row. Maybe something like....
col_1.......col_2.....code_1.....code_2....value_1.....value2
1000........ABC........M..........R.........200........300
November 4, 2004 at 6:35 pm
Thank you all so much for your help. I have it working now due to your efforts!
June 4, 2004 at 8:06 am
Thanks Chris -
Sorry, it's always a little difficult to explain these properly.
In your post above, where you start "A number of questions"....Everything after that is correct in your assumptions....
March 12, 2004 at 7:15 pm
Viewing 15 posts - 1 through 15 (of 19 total)