0
votes
0answers
7 views

MySQL query to group by and use distinct row

I have a table formatted as follows: mysql> select pattern,trunks,cost from sms_prices where pattern=1; +---------+--------------+-------+ | pattern | trunks | cost | ...
0
votes
0answers
17 views

How to avoid two results of the same row in join

I have three tables actually on virturt mart table one is orders, another is item & one is order_user_info to get the user first name i need to join order_user_info table but when i join it shows ...
0
votes
0answers
6 views

In SQLServer 2012 TSQL, what's the difference of using XML RAW, XML AUTO and XML PATH

As the title, all open minds are welcomed I tested in my computer, the output seems to be the same. For example. USE BOB_DATABASE SELECT ID, Name, First_Name, Last_Name FROM DBO.T_User FOR XML AUTO ...
0
votes
2answers
13 views

MySql order by (varchar) date in Mmm-dd-yyyy

So unfortunately I have a VARCHAR column of dates formatted like so: Jun-13-2013 (I understand that this is done incorrectly and should be stored in a DATETIME column in the standard format) I'm ...
0
votes
1answer
9 views

MYSQL: How to manually delete a database?

Any time I run this statement DROP DATABASE my_db; I get the following error message (ONLY with this database): **/* SQL Error (1010): Error dropping database (can't rmdir '.\my_db', errno: 41) */** ...
1
vote
1answer
41 views

Mysql field value is truncated when ordered in PHP

update seems to be an issue w/ mysql because it truncates it from the command line too anyway a db admin at my work figured it out.. see my solution In PHP (PDO, php_mysql, and php_mysqli all ...
0
votes
2answers
19 views

PHP/MySQL variable in URL - text being stripped out and numerical part only used in selecting database records

I have an SQL select statement which is intended to select data from a MySQL database when it matches the variable value entered in the URL, so if ?id=12 is appended to the URL it should return the ...
1
vote
4answers
50 views

How to combine two sql queries from same table

I have the following (example) data in a table Value, Date, Device I use the data to do simple SLA calculations, i.e. how many times during business hours was the data below a certain threshold. ...
0
votes
0answers
28 views

MySQL stopped accepting writes

I'm a beginner in MySQL and would like to know is it possible that MySQL locks the table for writes? And if yes how to avoid this. My current situation is I'm trying to wtite data to MySQL table ...
0
votes
1answer
53 views

How can I change this SELECT statement into an UPDATE statement?

I've managed to write a query which pulls back orders which do not have items in a separate table. I'd now like to update the xxx_orders based on the record set returned. Can it be done in one query? ...
0
votes
1answer
30 views

Making a login script safe using sessions

I am currently busy with my own login script that is simple but also safe enough to fit my goal. It uses MySQL to save the usernames and passwords. Now I came to the point of using sessions to be able ...
0
votes
1answer
15 views

Swapping two records in Oracle based on an order column

Simplifying, I have a table with a primary key and a sorting column: TABLE P ---------- id order 1 1 2 2 3 3 Suppose I want to "move up" the record with id 2, that is to swap the order ...
0
votes
2answers
29 views

Getting the values of a MySQL enum using only SQL

In a web application, I need to populate a <select> with all possible values of a MySQL enum. When I execute either of: SHOW COLUMNS FROM mytable LIKE 'mycolumn'; SELECT COLUMN_TYPE FROM ...
-3
votes
8answers
57 views

SQL query takes very very long, is it faulty or inefficient? [closed]

I have a database table where I want to select all rows for which there is a row with the same field1 and field2=5. I made the following SQL query: SELECT * FROM `table` WHERE `field1` IN (SELECT ...
-1
votes
1answer
28 views

Getting Error While Adding New Movie

Please Check the code Getting Error While Inserting the records You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ...

1 2 3 4 5 2009
15 30 50 per page