Problem
I'm joining two tables on postcode. I only have the data for the first half. The problem is where I have CM16 6BY in my user table and it matches CM1 and CM16 in my postcode table. Obviously I only want it to match with CM16 but I cannot write a query to do so. I'm sure I am doing something stupid but I am stuck. Can anyone help...
Hello to every one,
I've crated simple registration using Mysql connection in Vb.net but I am always getting exception error while form is loading but after closing dialog my registration form is loading and working properly. Where I am doing mistake? Anyone can help me with below code?
Public bool2 As Boolean = True
Dim mysqlconne...
How do you select all the columns from one table and just some columns from another table using JOIN? In MySQL.
Thanks!
...
Hi guys, I am trying to capture data from my form and pump it into a database, but when I try to input data into a column, I only get the uid, and the rest of the columns are empty.
Here is some code:
mysql_query("INSERT INTO personal_information (uid, name, surname, email, cell)
VALUES ('".$uid."', '".$name."', '".$surname."', '".$em...
I have an html form to select two dates from dropdown. Now I need to retrieve all records from a MySQL database which lie between those dates. Can anyone help me?
...
I need to check if some integer value is already in my database (which is growing all the time). And it should be done several thousand times in one script. I'm considering two alternatives:
Read all those numbers from MySQL database into PHP array and every time I need to check it, use in_array function.
Every time I need to check the...
We changed database schema and moved a relationship between users/accounts from a 1-1 to a many to many using a join table accounts_users.
So we have
accounts,
users,
accounts_users (user_id and account_id)
Our data is still 1-1, and we have decided to move back. So I need sql to move back:
To Migrate I used:
INSERT INTO accounts_us...
i am using MySQL workbench 5.2 CE database with a basic hibernate program
at run time it give me error:
Caused by: org.hibernate.HibernateException: JDBC Driver class not found: com.mysql.jdbc.Driver
this code in hibernate.cfg.xml:
<hibernate-configuration>
<session-factory>
<property name="dialect">org.hibernate.dial...
I would like to delete all the tables from database, but not deleting the database itself. Is it possible ? I'm just looking for shorter way than removing the database and create it again. Thanks !
...
what is the advantage of using pdo begintransaction, is this and mysql db lock are same?
I have a table with urls and status column, whenever my application loads 10 urls I need to update the status column as loaded. This application will be accessed by couple of users simultaneously, how would I prevent user B from loading the same url...
hi,
i'm working with java to extract values of a time column in table in mysql.
the code below show the query i do send.
String query="select id,time from table where Hour(time)<=32 ";
ResultSet res = stmt.executeQuery(query);
while (res.next()) {
String id = res.getString(1);
Time tc = res.getTime("time");
System.out.println(tc...
How can I order my resultset but also have a specific row (with fieldX = Y) be the first one?
...
Hi There,
I have this sql query, and it should be returning two values, which is does but it returns each returned row twice, the sql looks like this,
SELECT * FROM `mailers`
LEFT JOIN `mailer_content` ON `mailers`.`id` = `mailer_content`.`mailer_id`
LEFT JOIN `mailer_images` ON `mailer_content`.`id` = `mailer_images`.`content_i...
I have a table with the following columns:
id - INT UNSIGNED AUTO_INCREMENT
name - VARCHAR(20)
group - VARCHAR(20)
I know that I can add a row like this:
INSERT INTO table_name (name, group) VALUES ('my name', 'my group')
I wonder if there is a way to add a row without specifying the column names, like when there is no AUTO_INCREM...
Hi
I've got records that indicate when a job starts and when it ends. The End time is not recorded until the job ends, but the start time exists from the time the job starts. What I want is to know how many jobs were running in a given time period.
declare @data table (
JobId INT IDENTITY(1,1),
StartedAt DATETIME NOT NULL,
...
How do I change:
SELECT user.postcode, max(postcode.postcode) as postcode
FROM user
INNER JOIN postcode ON user.postcode LIKE CONCAT( postcode.postcode, "%" )
GROUP BY user.postcode
into an UPDATE similar to?
UPDATE user
INNER JOIN postcode ON user.postcode LIKE CONCAT(postcode.postcode, "%")
SET user.lat = postcode.lat, user.lng ...
I use MySQL database and C++ programming language.
In my database there are 20 tables. I produce different messages from these tables.
All tables include dateTime columns and I want to sort produced messages.
I did it by using union. But query is so long.
Do you think it has another way or my way is correct.
Thans a lot.
...
Hello,
I've got problems with special characters being inserted and displayed properly. It's an ASP.NET 3.5 application (C#) and the database is MySql.
If I try to insert a special character into the database using a console app I get an error back saying 'Incorrect string value: '\x81 etc'. If I try to display them it displays for exa...
Assume a table named 'log', there are huge records in it.
The application usually retrieves data by simple SQL:
SELECT *
FROM log
WHERE logLevel=2 AND (creationData BETWEEN ? AND ?)
logLevel and creationData have indexes, but the number of records makes it take longer to retrieve data.
How do we fix this?
...
Having a SQL table like
UserID |Attribute | Value
1 |Username | Marius
1 |Password | Fubar
I want to create an output like:
1 | Marius | Fubar
Maybe I'm just too tired to see it, doesn't sound too complicated, but I just can't seem to figure it out. Any help is appreciated.
...