LMSouq

Knowledge Base

Browse Moodle Solutions

2108 solutions found

Page 44 of 106
0 votes
1 ans
3 views
How to select the nth row in a SQL database table?

I'm interested in learning some (ideally) database agnostic ways of selecting the *n*th row from a database table. It would also be interesting to see how t...

database Solved
CH
asked 1 month ago by Charles Roper
0 votes
1 ans
3 views
How can I do three table JOINs in an UPDATE query?

I asked a question and got this reply which helped. UPDATE TABLE_A a JOIN TABLE_B b ON a.join_col = b.join_col AND a.column_a = b.column_b...

database Solved
RI
asked 1 month ago by Ricky
0 votes
1 ans
3 views
How can I check MySQL engine type for a specific table?

My MySQL database contains several tables using different storage engines (specifically myisam and innodb). How can I find out which tables are using which e...

database Solved
ON
asked 1 month ago by oneself
0 votes
1 ans
3 views
How do I show the schema of a table in a MySQL database?

From the [MySQL](https://www.mysql.com/) console, what command displays the schema of any given table?

database Solved
DL
asked 1 month ago by dlamblin
0 votes
1 ans
3 views
Delete all Duplicate Rows except for One in MySQL?

How would I delete all duplicate data from a MySQL Table? For example, with the following data: SELECT * FROM names; +----+--------+ | id...

database Solved
HI
asked 1 month ago by Highway of Life
0 votes
1 ans
3 views
Convert from MySQL datetime to another format with PHP

I have a `datetime` column in MySQL. How can I convert it to the display as **mm/dd/yy H:M (AM/PM)** using PHP?

database Solved
TI
asked 1 month ago by Tim Boland
0 votes
1 ans
3 views
PDOException SQLSTATE[HY000] [2002] No such file or directory

I believe that I've successfully deployed my (very basic) site to fortrabbit, but as soon as I connect to SSH to run some commands (such as `php artisan mig...

database Solved
DA
asked 1 month ago by Daniel Hollands
0 votes
1 ans
3 views
Getting "Lock wait timeout exceeded; try restarting transaction" even though I'm not using a transaction

I'm running the following MySQL `UPDATE` statement: mysql> update customer set account_import_id = 1; ERROR 1205 (HY000): Lock wait timeout e...

general-dev Solved
JA
asked 1 month ago by Jason Swett
0 votes
1 ans
3 views
Select all columns except one in MySQL?

I'm trying to use a select statement to get all of the columns from a certain MySQL table except one. Is there a simple way to do this? EDIT: There are 5...

database Solved
TO
asked 1 month ago by Tom Grochowicz
0 votes
1 ans
3 views
MySQL JDBC Driver 5.1.33 - Time Zone Issue

Some background: I have a Java 1.6 webapp running on Tomcat 7. The database is MySQL 5.5. Previously, I was using Mysql JDBC driver 5.1.23 to connect to the...

database Solved
BL
asked 1 month ago by bluecollarcoder
0 votes
1 ans
3 views
Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (38)

I am having a big problem trying to connect to mysql. When I run: <!-- language: shell --> /usr/local/mysql/bin/mysql start I have the followin...

server-admin Solved
LA
asked 1 month ago by Lambivist
0 votes
1 ans
3 views
SQL query return data from multiple tables

I would like to know the following: - how to get data from multiple tables in my database? - what types of methods are there to do this? - what are joins a...

database Solved
FL
asked 1 month ago by Fluffeh
0 votes
1 ans
3 views
Update a column value, replacing part of a string

I have a table with the following columns in a MySQL database [id, url] And the URLs are like: http://domain1.example/images/img1.jpg I wan...

php-dev Solved
AD
asked 1 month ago by Addev
0 votes
1 ans
3 views
How to use GROUP BY to concatenate strings in MySQL?

Basically the question is how to get from this: <pre> foo_id foo_name 1 A 1 B 2 C </pre> to this: <pre>...

database Solved
PA
asked 1 month ago by Paweł Hajdan
0 votes
1 ans
3 views
How can I search (case-insensitive) in a column using LIKE wildcard?

I looked around some and didn't find what I was after so here goes. SELECT * FROM trees WHERE trees.`title` LIKE '%elm%' This works fine,...

general-dev Solved
DA
asked 1 month ago by David Morrow
0 votes
1 ans
3 views
You can't specify target table for update in FROM clause

I have a simple mysql table: CREATE TABLE IF NOT EXISTS `pers` ( `persID` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(35) NOT NULL,...

general-dev Solved
CS
asked 1 month ago by CSchulz
0 votes
2 ans
3 views
MySQL: Insert record if not exists in table

I am trying to execute the following query: INSERT INTO table_listnames (name, address, tele) VALUES ('Rupert', 'Somewhere', '02...

database Solved
RU
asked 1 month ago by Rupert
0 votes
1 ans
3 views
Get record counts for all tables in MySQL database

Is there a way to get the count of rows in all tables in a MySQL database without running a `SELECT count()` on each table?

database Solved
MA
asked 1 month ago by Mark
0 votes
1 ans
3 views
Error Code: 2013. Lost connection to MySQL server during query

I got the > Error Code: 2013. Lost connection to MySQL server during query error when I tried to add an index to a table using MySQL Workbench. I...

server-admin Solved
US
asked 1 month ago by user836026
0 votes
1 ans
3 views
How to create a MySQL hierarchical recursive query?

I have a MySQL table which is as follows: | id | name | parent_id |:--:|:-----------:|:---------: | 19 | category1 | 0 | 20 | category2...

database Solved
TA
asked 1 month ago by Tarun Parswani