If a bulk MySQL insert takes 5 minutes to complete, and one of the columns in the table is a TIMESTAMP column with a default value of CURRENT TIMESTAMP, will the timestamps of the rows that were inserted be reflective of the entire 5 minutes, or will they all default to the same timestamp from beginning or the end of the query? The bulk insert exists within a transaction.

Member Avatar
Member Avatar
+0 forum 3

Hi to all! I'm fairly new to using High availability group and i've been having issues with storage space from my Logs drive from my primary server.. I just want to know why is my Log file not shrinking after I do backups(Full) on the primary server.. also, another question.. can I do the backup on my secondary server before shrinking my Logs on the primary? the reason I want to do this because my primary server has a database primarily used for Production(MES) and I don't want any downtime on their part.. Thanks in Advance.

Member Avatar
Member Avatar
+0 forum 4

Hello i have a project that uses firebase but i want to make connect to my MySql database on xampp. Any idea what to do?

Member Avatar
Member Avatar
+0 forum 1

I have been cracking my head on this mater in the past couple of days. I am faced with a situaton where i need to write a MySQL equivalent of PHP code to loop through sql select results. The Php code looks like this $query = "SELECT pubid, author FROM refs"; $sql=$con->prepare($query); $sql->execute(); $sql->setFetchMode(PDO::FETCH_ASSOC); while ($row=$sql->fetch()){ $id= $row['pubid']; $author = $row['author']; $name = explode('., ', $author); } How can one write sql/mysql query that does the same?

Member Avatar
Member Avatar
+0 forum 6

Hi Please why I got this error(SQL Error: ORA-00907: missing right parenthesis) whats wrong in my code? CREATE TABLE artphoto( photonr NUMBER(10), artnr NUMBER(10) NOT NULL, filtyp VARCHAR2(5) NOT NULL, path VARCHAR2(100) NOT NULL, CONSTRAINT artphoto_photonr_pk PRIMARY KEY(photonr), CONSTRAINT artphoto_artnr_fk FOREIGEN KEY(artnr), REFERENCES art(artnr), CONSTRAINT artphoto_filtyp_ck CHECK(filtyp in ('gif','jpg')) ); Error starting at line 1 in command: CREATE TABLE artphoto( photonr NUMBER(10), artnr NUMBER(10) NOT NULL, filtyp VARCHAR2(3) NOT NULL, path VARCHAR2(200) NOT NULL, CONSTRAINT artphoto_photonr_pk PRIMARY KEY(photonr), CONSTRAINT artphoto_artnr_fk FOREIGEN KEY(artnr), REFERENCES art(artnr), CONSTRAINT artphoto_filtyp_ck CHECK(filtyp in ('gif','jpg')) ) Error at Command Line:8 Column:44 Error report: SQL Error: ORA-00907: …

Member Avatar
Member Avatar
+0 forum 9

I was attempting to store chat logs in a MySQL database where the message field is utf8_general_ci However, when it came across an emoji, it would choke, and the message field would only include text up to the emoji character. I changed the message field to be utf8mb4_general_ci, which seemed to be suggested upon googling, and now emoji characters are replaced in the database with four question mark characters, instead of choking. What is the best way to encode/decode emoji characters so that they can be accurately represented? (Ideally with PHP)

Member Avatar
Member Avatar
+0 forum 6

Hi everyone, I have database which has data of past 2 years. I want to get that data for current financial year. [COLOR="Green"](Here financial year is 1st april to 31st of March)[/COLOR] This query returns data for current calender year i.e. [Jan-to-Dec] [COde=sql] SELECT DATENAME(MONTH, DATE) AS MonthName, SUM(NetAMOUNT) AS dsfd from SALESMASTER GROUP BY DATEPART(MONTH, DATE), DATENAME(MONTH, DATE) ORDER BY DATEPART(MONTH, DATE)[/COde] I want to see the same data in the form of financial year i.e. [April-to-March] just take care financial year involves 9 months of previous year and 3 months of current year. please reply..

Member Avatar
Member Avatar
+0 forum 4

I got a syntax error flag in my "users" database table, but can't figure the issue out. Please, I need your help. The following is the error message: Error SQL query: --------------------------------------------------------- -- -- -- Table structure for table `users` -- CREATE TABLE IF NOT EXISTS `users` ( `user_id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT , `username` VARCHAR( 255 ) COLLATE utf8_unicode_ci NOT NULL , `firstname` VARCHAR( 32 ) COLLATE utf8_unicode_ci NOT NULL , `lastname` VARCHAR( 32 ) COLLATE utf8_unicode_ci NOT NULL , `email` VARCHAR( 255 ) COLLATE utf8_unicode_ci NOT NULL , `phone` VARCHAR( 30 ) COLLATE utf8_unicode_ci NOT …

Member Avatar
Member Avatar
+0 forum 2

Is the method in MySQL to set in SQL script dynamic log file name? e.g in Oracle PL/SQL set define on column sdate new_value sdate select to_char(sysdate,'YYYY.MM.DD_HH.MI') sdate from dual; spool 'logs/install_&sdate..log'; e.g. in PG/SQL \o ./logs/install_`date +"%Y-%m-%d_%H%M"`.log but I cant find similar in MySQL \T ??????

Member Avatar
Member Avatar
+0 forum 6

Dear all, I have a scenario, where I have a single table with all my users listed in them. Each user also has a field indicating the user they report to. UserID UserDisplayName UserReportsTo ----------- ------------------------------------------------------------ ------------- 8 Anthony Karimi 3 9 naheed kassam 8 1 Administrator 1 3 Ramakrishna 2 2 SB 2 (5 row(s) affected) In my scenario, i need when the user selected is say userid = 3, then the table displays userid = 3; userid = 8 who reports to userid = 3; and userid = 9 who reports to userid = 8 as shown below …

Member Avatar
Member Avatar
+0 forum 4

Hello all members, I am new to this this website. I am working on an assignment and I have a scenario where I have to find the key attributes, entities and keys. Below is the scenario, An international courier, express and parcel Services Company is setting up a package shipping system for customers to ship packages. Whenever a customer wishes to ship a package, they can call the company‚Äôs customer service personnel to place a shipment request. A computer system is needed to track the shipment details of the package. This will enable the company to keep track of their …

Member Avatar
Member Avatar
+0 forum 3

We have a MS Access database located on a shared drive. Is there a way I can allow multiple users to access and update the database at the same time?

Member Avatar
Member Avatar
+0 forum 6

Hi, i have installed prestashop 1.4.8.2 & i need a report of first order date for each customers, please help me to create mysql query. i need below columns information from database. id_customer, firstname, lastname, first order date thanks, Ritesh

Member Avatar
Member Avatar
+0 forum 12

I currently have some code that gets the overall top 25 frame sales, which is as follows: `Dim FrameCountSelectStr As String = "SELECT TOP 25 Count(Glasses.OrderID) AS GlassesCount, Glasses.Manufacturer, Glasses.FrameName FROM(Glasses) WHERE FrameName <> '' AND OrderDate >= #" & SearchDateStart & "# AND OrderDate < #" & SearchDateEnd & "# GROUP BY Glasses.Manufacturer, Glasses.FrameName ORDER BY Count(Glasses.OrderID) DESC"` What I would also like to do is get the top 25 frame sales for each DISTINCT company and group the results by company (and order by count). I tried the following but I am not having any luck: `Dim FrameCountSelectStr …

Member Avatar
Member Avatar
+0 forum 6

I have been butting my head against this problem for the past 4 hours, and I have to tap out. I know I can't be too far from correct I am just not sure what the missing ingredients are. Here is the problem question: Student status: List of all students and their enrollment status Fields: student last name and first name (comma separated), years enrolled, academic advisor last name and first name (comma separated) Sort: years enrolled Input: none Filter: only include currently active students and My code: SELECT student_id,std_l_name, std_f_name, faculty_l_name, faculty_f_name,student_id_fk,enroll_date,MONTHS_BETWEEN(CURRENT_DATE ,enroll_date) V1: FROM STUDENT, FACULTY,ENROLLMENT WHERE FACULTY.faculty_id=STUDENT.faculty_id_fk3 …

Member Avatar
Member Avatar
+0 forum 2

I have the following script which successfully finds the values for $payer_email, reminder_date and sub_expire_date, however where I am having trouble is when I apply a WHERE condition to the SELECT. The condition I am trying to apply is the commented out line at the end of the SELECT. The intention of the WHERE is to filter the values from the SELECT to only provide those values which point to the subscription expiry (sub_expire_date) thirty days ahead of time, but no values are found when they really should be. Can anyone tell me what is wrong? <?php error_reporting(E_ALL ^ E_NOTICE); …

Member Avatar
Member Avatar
+0 forum 1

Am trying to create edit-form but there are some problem which I cant determine by my self. I cant echo inserted record and updating. <?php include("db_con.php"); $edit_reg_no = filter_input(INPUT_GET, 'edit_customer_detail', FILTER_VALIDATE_INT, ['options' => ['default' => NULL]]); if(isset($_POST['update'])){ $update_reg_no = $edit_reg_no; //getting the text data from the fields $d_fname = $_POST["d_fname"]; $d_lname = $_POST["d_lname"]; $customer_name = $_POST["customer_name"]; $mobile = $_POST["mobile"]; $office_tel = $_POST["office_tel"]; $email_fax = $_POST["email_fax"]; $model = $_POST["model"]; $engine = $_POST["engine"]; $vin = $_POST["vin"]; $work_carry = $_POST["work_carry"]; $demage_found = $_POST["demage_found"]; $accessories = $_POST["accessories"]; $car_received = $_POST["car_received"]; $mileage_covered = $_POST["mileage_covered"]; $update = "update customer_details set d_fname='$d_fname', d_lname='$d_lname', customer_name='$customer_name', mobile='$mobile', office_tel='$office_tel', email_fax='$email_fax', …

Member Avatar
Member Avatar
+0 forum 3

I am using MS SQL and have logs that are in .mdf and .ldf format. It took us a while but we figured out how to get our new settings correct and coming in w3c format. The olf files are still .mdf and I need to know what I can do to open them and view them. I have no database experience and want to know if there is a program I can use to do so. I have tried MSDEtoText.vbs and were unsuccessful running the script. Any suggestions will be greatly appreciated.

Member Avatar
Member Avatar
+0 forum 3

Hi guys, i have a login page where i created a session trainer after login. the session is the mail address of the trainer. now from another apsx page, i would like to retrieve the staffid of the user logged in using the session as criteria. I tried to write the below code but its not working. Any ideas please? Dim cmd As New SqlCommand Dim query1 As String query1 = "SELECT staffid FROM tblstaff WHERE email='" & Session("trainer") & "'" connect.ConnectionString = Constr connect.Open() cmd = New SqlCommand(query1, connect) Dim rdr As SqlDataReader = cmd.ExecuteReader Dim bFound As Boolean …

Member Avatar
Member Avatar
+0 forum 1

Hi not sure if this is possible so wanted some guidance.. I have a database with 3 columns.. id, data,timestamp id is auto increment and data is json array and timestamp is unix timestamp.. the field I wanted to update was data but I wanted to replace just a part of it.. see sample data below (id, data, timestamp) (1, '{"Employee_Number":"235","First_Name":"Test","Middle_Name":"TEST2"}',1495120538) I wanted to replace the 235 with 544 but I will not know what data there is in the data field .. I will only know the id I tried UPDATE `table` SET `data`= replace(data, '{"Employee_Number":"%","First_Name"', '{"Employee_Number":"544","First_Name"') WHERE `id` …

Member Avatar
Member Avatar
+0 forum 3

**I can't update inserted data via GUI, Its working well on inserting records before I modify it, and when am trying to modify in order to update inserted data its not update as I expect to happen. I can display inserted data well by echo them to GUI Below is the update form that Am trying to create Please help me. Am just a beginner, thanks** <?php include ("db_con.php"); if(isset($_POST['update'])){ $update_id = $post_id; //getting the text data from the fields $post_title = $_POST["post_title"]; $category_id = $_POST["category_id"]; $post_author = $_POST["post_author"]; $post_keywords = $_POST["post_keywords"]; $post_content = $_POST["post_content"]; //getting the image form the …

Member Avatar
Member Avatar
+0 forum 2

Good day, I having a problem where creating my setting table as condition below column User_id setting effective_date effective_end_date Row 1: 1 ABC 2017-03-01 2018-02-28 Row 2: 1 DEF 2018-03-01 2019-03-01 I wish to add a constraint to block if same user add in a setting with the effective_date or effective_end_date between existing setting. Is that posible? I had searching and trying for a few days now without succeed to archive what I trying to do. Please kindly guide me through this. Thanks in advance.

Member Avatar
Member Avatar
+0 forum 1

Hello, so, I'm playing a bit with **MariaDB 10.0.29** and I cannot understand why `FOUND_ROWS()` keeps returning the `1` whatever happens to the latest select query. Here's my test: > CREATE TABLE `test` (`id` INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, `msg` VARCHAR(100) NULL) ENGINE = InnoDB; Query OK, 0 rows affected Time: 0.782s > INSERT INTO `test` (`msg`) VALUES('apples'), ('oranges'), ('strawberries'), ('cherries'), ('random'); Query OK, 5 rows affected Time: 0.180s > SELECT SQL_CALC_FOUND_ROWS * FROM `test`; +------+--------------+ | id | msg | |------+--------------| | 1 | apples | | 2 | oranges | | 3 | strawberries | | 4 | …

Member Avatar
Member Avatar
+0 forum 6

SAMPLE TABLE 1 =================================== product Division sales % =================================== product1 divsion1 99 product2 divsion1 51 product3 divsion1 50 product4 divsion2 98 product5 divsion2 41 product6 divsion2 40 product7 divsion3 97 product8 divsion3 31 product9 divsion3 30 =================================== Expected output 1 =================================== product2 divsion1 51 product3 divsion1 50 product5 divsion2 41 product6 divsion2 40 product8 divsion3 31 product9 divsion3 30 Hi All, I am having a single table. In this table I need to get product name which is not having maximum sale % for each division. Please help me to get this results. Thanks in advance.

Member Avatar
Member Avatar
+0 forum 6

The issue I am having has to do with not being able to show different OrderDate for the same Unit Unit OrderDate ShipDate ReceiptDate Robot 20160101 20160102 20160103 Robot 20160102 20160103 20160104 Robot 20160103 20160104 20160105 What is happening instead is that it is showing the same OrderDate for all three records. Unit OrderDate ShipDate ReceiptDate Robot 20160101 20160102 20160103 Robot 20160101 20160103 20160104 Robot 20160101 20160104 20160105 select salesorder.unitid "Unit",max(salesorder.eventdate) "OrderDate",max(salesdelivery.eventdate) "ShipDate",max(salesreceipt.eventdate) "ReceiptDate" from (select eventdate,unitid from sales where event='ORDER' and eventdate>'2015-12-31' and eventdate<'2016-02-01') salesorder left outer join (select eventdate,unitid from sales where event='SHIP' and eventdate>'2015-12-31' and eventdate<'2016-02-01') salesdelivery …

Member Avatar
+0 forum 0

Hi hope someone can help me Read sqlite datatable is verry slow I have a listview in detail mode with 45 columns. and a datatable to add, read, delete and update datarows with 45 colums. Only i have a problem to read the datatable and show it all in the listview, its verry slow at the moment i have 10.000 datarows in the table and i have to wait about 6 seconds to load it to the listview. Later there will be come about 10.000.000 and maby more datarows in the table so than i have to wait about 6000 …

Member Avatar
Member Avatar
+0 forum 8

`Select * from contacts WHERE behavior = 'nice'` [SQL Clause is coming to town.](http://imgur.com/gallery/KvsXO) Not mine, [Little Bobby Tables](https://www.explainxkcd.com/wiki/index.php/Little_Bobby_Tables) almost ruined Christmas.

Member Avatar
+1 forum 0

Hello friends. Please help me to solve my problem. I am using sql server 2008. When I try to access it recieve the following error: "Cannot connect to localhost ". So my question is, how to repair sql server? Hopefully someone will be able to help me with this.

Member Avatar
Member Avatar
+0 forum 4

I am working on a report that is requesting to count the total number of errors per element in the total row of the report for a given County. When I use the COUNT function it is taking the max value from the number of reads complete column for that district instead of actually tallying the errors in the column. When I use the MAX function it is just placing a 1 there but not actually adding the errors either. Also when using the SUM function, it gives me the same values as the COUNT function. Here is what I …

Member Avatar
+0 forum 0

Hi to all! I am using sql server 2008 enterprise edition. My instance name is "saboor-pc/ SQLSERVERENT". I am using this server for many months and i am satisfied but today an unexpected error occured when i clicked on "connect" button in sql server management studio. The error was: "Cannot connect to SABOOR-PC/MSSQLSERVERENT A connection was successfully established with the server, but then an error occured during the pre-login handshake(provider: SSL Provider, error:0 The message recieved was un expected or badly formatted)(MicroSoft SQL Server)" above is the error statement in double quots. Please guide me how can i solve this …

Member Avatar
Member Avatar
+0 forum 7

The End.