If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > help I need to know...

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-30-04, 16:04
Mike White Mike White is offline
Registered User
 
Join Date: Sep 2004
Posts: 2
help I need to know...

I currently am trying (operative word here is "trying") to design a form that I can use with a database which contains over 30 tables of information.

However, I'm stuck as to how to design a query that can check all the tables and come back with any duplicates. Also, I am trying to write a query that can append a new record. Can someone help? I know I should know this, but I'm just learning.

Thanks so much.

Mike
Reply With Quote
  #2 (permalink)  
Old 09-30-04, 17:52
yellowmarker yellowmarker is offline
Registered User
 
Join Date: Jul 2004
Location: Dundee, Scotland
Posts: 107
this might help...

to find a duplicate row in a table use something like:
SELECT field_name FROM `table_name` GROUP BY field_name HAVING count(*) > 1

...perhaps you might repeat that check for each table in a loop?

to insert (append) a row into a table use something like:
INSERT INTO `table_name` (`field1`, `field2`) VALUES ('value1', 'value2' )
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On