Sponsored Content
Top Forums Shell Programming and Scripting UPDATE COmmand post comparing 2 columns in 2 mysql tables Post 302946394 by siya@ on Tuesday 9th of June 2015 02:45:17 AM
Old 06-09-2015
UPDATE COmmand post comparing 2 columns in 2 mysql tables

my queryis :

select distinct m.name, item_count, item from master m join client p on m.name=p.name where item_count = 1 and item > 1;
[/CODE]But how should I update them?

i used update statetment :

Code:
Update from client Set item =1  where m.name=p.name and item_count=1 AND item>1

Is this wrong?

Last edited by siya@; 06-19-2015 at 04:18 AM..
 

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Converting tables of row data into columns of tables

I am trying to transpose tables listed in the format into format. Any help would be greatly appreciated. Input: test_data_1 1 2 90% 4 3 91% 5 4 90% 6 5 90% 9 6 90% test_data_2 3 5 92% 5 4 92% 7 3 93% 9 2 92% 1 1 92% ... Output:... (7 Replies)
Discussion started by: justthisguy
7 Replies

2. Shell Programming and Scripting

comparing two tables

I am comparing two table structure in different databases,Put into 2 txt files , when comparing if column sequnce and data type is not matching ,it has to display that info else Table structure is ok. wrote shell script ,its not working .I am getting "Table structure is not ok" even if both... (1 Reply)
Discussion started by: akil
1 Replies

3. Shell Programming and Scripting

Shell script for comparing data of tables

Hi, I have two databases with same tables on different servers.I need to check the data content in each table and if something is missing, should print that. I have a tool which takes the snapshot the table structure,index so on and compares with the other server tables snapshot. Now i need... (1 Reply)
Discussion started by: nessj
1 Replies

4. Web Development

mysql query for multiple columns from multiple tables in a DB

Say I have two tables like below.. status HId sName dName StartTime EndTime 1 E E 9:10 10:10 2 E F 9:15 10:15 3 G H 9:17 10:00 logic Id devName capacity free Line 1 E 123 34 1 2 E 345 ... (3 Replies)
Discussion started by: ilan
3 Replies

5. Programming

MySQL join four tables!

Hello; I want merge four MySQL tables to get the intersection that have a common field for all of them. Join two tables is fine to me, but my this case is different from common situations and there are not very many discussions about it. Can anybody give me some idea? Thanks a lot! Here is part... (8 Replies)
Discussion started by: yifangt
8 Replies

6. Shell Programming and Scripting

Show only new and removed records by comparing to MySQL tables

Hello all; I have been really frustrated with finding the correct perl code (and MySql statements) to accomplish what I thought was straight forward...I have tested I don't know how many different codes\suggestions I found on the net without any success...but anyhow let me explain my plight and... (0 Replies)
Discussion started by: gvolpini
0 Replies

7. Shell Programming and Scripting

Comparing two tables

I have defined a set of global variables at the beginning of my script as below: #ideal values export ITEM1=SUCCESS export ITEM2=FAILURE export ITEM3=UNAVAILABLE export ITEM5=FAILURE export ITEM6=SUCCESS now I have a shell script function which returns a value in below format. ITEM1... (1 Reply)
Discussion started by: ctrld
1 Replies
XmListReplaceItems(3X)													    XmListReplaceItems(3X)

NAME
XmListReplaceItems - A List function that replaces the specified elements in the list SYNOPSIS
#include <Xm/List.h> void XmListReplaceItems (widget, old_items, item_count, new_items) Widget widget; XmString *old_items; int item_count; XmString *new_items; DESCRIPTION
XmListReplaceItems replaces each specified item of the list with a corresponding new item. When the items are inserted into the list, they are compared with the current XmNselectedItems list. If any of the new items matches an item on the selected list, it appears selected. Specifies the ID of the List widget Specifies the items to be replaced Specifies the number of items in old_items and new_items This number must be non-negative. Specifies the replacement items Every occurrence of each element of old_items is replaced with the corresponding element from new_items. That is, the first element of old_items is replaced with the first element of new_items. The second element of old_items is replaced with the second element of new_items, and so on until item_count is reached. For a complete definition of List and its associated resources, see XmList(3X). SEE ALSO
XmList(3X) XmListReplaceItems(3X)
All times are GMT -4. The time now is 01:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy