MySQL: Is there a way to reset a table?
Is there a way to reset a table? I mean not only deleting all rows, but starting the auto_incrementing ID back to 0? ...
Is there a way to reset a table? I mean not only deleting all rows, but starting the auto_incrementing ID back to 0? ...
I have three tables menus +--id---ident---+ |--1----menu_1--| menus_data +--id---id_parent---name---------id_lang--+ |--1----1-----------menu_eng------1-------| |--2----1-----------menu_rus------2-------| +--3----1-----------menu_arm------3-------+ languages +--id---name--------+ |--1----english-----| |--2----russian-----| |--3--...
I am writing a c++ application that uses mysql, and I am having a problem with including in my project. I am using netbeans with remote development and I am wondering how do I add the mysql folder (/usr/local/mysql/include/mysql/) into my include path over remote development. I notice that netbeans copies across all standard libraries...
My first experience developing DBMS-based apps was with IMS, using COBOL calls to DLI. Later on, I worked with several other products, on a smaller scale, such as: DBASE, INFORMIX 3.3/SQL and ORACLE on DOS, UNIX-XENIX and VAX/VMS platforms. When I was a product planner for AT&T-IS Labs, I had the opportunity to eval several RDBMS-based a...
I have a model: class MyModel(models.Model): a = models.IntegerField() b = models.IntegerField() c = models.IntegerField() Now, I need something like unique_together(a,b, max_occurences=3) constraint to be added to the above model (so that there can be up to 3 values of c for each pair of (a,b), and ideally those 3 val...
Please be patient with my question, as this may be a bit longer. If you look at Magento and try to compare with any other non-PHP eCommerce Shopping Cart websites, you will find that the latter are comparatively faster. I know that the following factors work as well:- Hosting Server Bandwidth Magento offers lots & lots of features, ...
Ok so I've a SQL query here: SELECT a.id,... FROM article AS a WHERE a.type=1 AND a.id=3765 ORDER BY a.datetime DESC LIMIT 1 I wanted to get exact article by country and id and created for that index with two columns type and id. Id is also primary key. I used the EXPLAIN keyword to see which index is used and instead of the multiple...
Hi, I am writing to ask for advice. I have to monitor certain "insert" on a mysql db. In what way is more convenient to do this? The application uses Servlets and MySQL. Thank you very much ...
Using mysql I want to display two rows values in to single value ID Name --------- 01 Raja 02 Ravi Expected output: 01Raja 02Ravi How to make a query for this condition? ...
I have an sql query that counts the number of results for a complex query. The actual select query is very fast when limiting to 20 results, but the count version takes about 4.5 seconds on my current tables after lots of optimizing. If I remove the two joins and where clauses on site tags and gallery tags, the query performs at 1.5 sec...
In my form, there are values to be inserted to multiple tables. After inserting to the first table, i have to insert the other values, along with the 'id' of the entry to first table as reference. What is the best way to do this? Is there any codeigniter specific way? ...
I have a blog built that is grabbing information from another set of tables in the MU Database. I need to now be able to also search that database. Does anyone have that MySQL query needed to make a clean search? ...
I have a query I need to perform to show search results for a project. What needs to happen, I need to sort the results by the "horsesActiveDate" and this applies to all of them except for any ad with the adtypesID=7. Those results are sorted by date but they must always result after all other ads. So I will have all my ads in the res...
Is it possible to use AND in a join condition? For example: SELECT * FROM items LEFT JOIN products as prod ON prod.prod_id = items.prod_id LEFT JOIN partial as p ON p.prod_model = prod.prod_model AND p.order_id=$order_id WHERE order_id = $order_id ORDER BY prod.prod_weight ASC I am guessin...
I am trying to update a field in my table based on if it exists in two join tables. update quotes inner join collection_records ON quotes.id <> collection_records.record_id inner join subcollection_records ON quotes.id <> subcollection_records.record_id set quotes.status_id = 1 where collection_records.type = 'Quote' or subcollectio...
I am using a form through a PHP CMS system, that defines custom fields and such. One of the custom fields allows for an input field which does a smart search. What this means is that when you start typing, it shows the records that match, quite similar to google suggest. The smartsearch input field relies on a stored mysql search, and ...
Okay, so I'm getting my MySQL Version like so: preg_replace('#[^0-9\.]#', '', mysql_get_server_info()); Which gives me a number like: 5.1.36 That's all good. What I need to do, is compare that version with another version. I was about to attempt to write my function to compare them, when I thought of version_compare(). However, upon ...
Can anyone suggest a cleaner method to delete rows with a one-to-many relationship in one query? This works, but I'm not very familiar with the using clause or delete, so I don't fully understand how it works. DELETE FROM ip_record, entry using ip_record inner join entry where ip_record.site_id = ? ...
hi, I tried to deploy ror application on production server then got this error: Access denied for user 'root'@'localhost' (using password: YES) (Mysql::Error) but when i ran command: rake db:migrate RAILS_ENV=production it passed. I also connect to mysql from command line: mysql -u root -p it got through, and i can see all t...
HI I am still confused that whether I need to use multiple table in a single database or single table in single database?? I do have near about 30 columns for one record. ...