Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: aalnaif
  • Content: Threads
  • Order by date
  1. aalnaif

    Excel: Selecting an adjacent column based on value of previous column

    Hi, I know the title is confusing, but I have a column in which all rows are zero except one, which is equal to "1". I would like a formula to set a cell equal to the next column in that row (which is equal to 1). For example, take the following data (seperated into two columns): 0 | Bob 0 |...
  2. aalnaif

    Automatically Deleted Files on Local Drive

    Hi, I'm at work, and I left my computer to go to eat lunch. For some reason, when I returned all of my files in My Documents on my local drive were automatically deleted. Does anyone know why this could have possibly occured? No one else had access to my computer while I was gone.
  3. aalnaif

    AND Gate Filtering Sequence in MySQL

    I was wondering about the filtering sequence that MySQL performs on AND gates. For example, consider the following query: select * from expl_table where ColA > 30 and ColB < 15; Does MySQL first select rows where ColA > 30, and then further filter the resultset for ColB < 15, or does it...
  4. aalnaif

    History Table

    I want a mechanism for recording the history of our employees' salaries. Using this mechanism, I should be able to easily obtain a salary given an employee's ID and a date. Any suggestions?
  5. aalnaif

    Deleting rows faster than filtering rows

    I am creating a temporary table which is simply a copy of two tables joined together, excluding rows which meet a certain criteria. For some reason, it is much faster for me to make a full copy of the joined tables, and then delete from the table the rows which meet the criteria, than it is to...
  6. aalnaif

    Selecting the correct row in a table which records changes

    I have an "employees" table which records which department each employee has worked in, and the date that each employee started working in their departments. Since it is possible for an employee to change departments, a single employee can have several records in this table. For example...
  7. aalnaif

    Bash mail not working

    I wrote the following simple bash script to send mail: #!/bin/bash SUBJECT="testsubj" EMAIL="username@domain.com" EMAILMESSAGE="/tmp/emailmessage.txt" echo "testbody">$EMAILMESSAGE /bin/mail -s "$SUBJECT" "$EMAIL" < $EMAILMESSAGE The script runs fine (no errors are returned), but...
  8. aalnaif

    Importing a constant value using mysqlimport

    I have a tab-delimited .txt file with 3 columns, which I want to import into a table with 4 columns. All of the table's 4 columns are included in a unique key. The .txt file looks like this Bob Billy 23945 Adams John 34535 Smith Chris 34593 The column headings for the...
  9. aalnaif

    MySQL Storage

    This might be a Linux question, as it has to do with where MySQL stores its database tables when you install it in a Linux based OS (Cent OS). I want to put the MySQL tables and database information on a separate hard drive. I'm thinking the easiest way to do this is to mount the folder where...
  10. aalnaif

    Bash scripting - using variables in MySQL queries

    I am writing a bash script to update a MySQL table using a previously defined variable. For some weird reason, the value that is populated in the table does not match the value of the variable. Here is my code: var_date="2007-03-15" mysql -u username -ppassword dbname -e "update...
  11. aalnaif

    Adding column to tab-delimited file

    I am writing a bash script to automatically import a tab-delimited file into an MySQL database. The problem is that I want to add a date column to the file before I import it into the database. The date is included in the filename. For example, assume a file named patientinfo_20070217.txt...
  12. aalnaif

    Change modification time of file

    Is there a Linux bash command to set the modification time of FileA to that of FileB? For example, assume FileA was last modified at 5:30, and FileB was last modified at 6:30, and currently it is 7:30. I would like to change the modification time of FileA to 6:30.
  13. aalnaif

    Select * except 3

    I want to select all columns from a table, EXCEPT three, which are called "id", "name", and "active". I can't simply tell MySQL to select all the other columns, because I do not know beforehand how many columns there will be, or what they will be called. Is there something like this that I can...
  14. aalnaif

    Updating table with reference to another table

    I am trying to update two columns of a table (date and location) so that they are equal to the date and location of another table on a lastname join. Here's is the code I have right now: update tblA set tblA.date = tblB.date, tblA.location = tblB.location where tblA.lastname = tblB.lastname...
  15. aalnaif

    Error 124

    I'm getting the following error when I try to call a procedure 'Got Error 124 from storage engine.' Does anyone know what this means?
  16. aalnaif

    Variables in a procedure

    What's the proper way to use a variable in a procedure? Whenever I try and initialize one, I'm getting an error that I'm not using the proper syntax. Because I can't initialize it, whenever I try and use it I'm getting a null result. The variable is to be used inside a case when statement that...
  17. aalnaif

    Searching for existence of specific value within column

    Consider the following pseudo-code for an IF statement: if(maintable.call_type contains at least one instance of 'E') then ... Call_time is a column within maintable. For example, if maintable.call_time contained the values {A,A,B,D,A,B,E,B,C,E,D} then the statements inside the...
  18. aalnaif

    Declaring variables

    I know this is really simple, but I've been suck on this for 2 hrs and I can't figure it out. I'm getting a syntax error when declaring a variable within an UPDATE statement. Here's how I'm declaring it: DECLARE cnt int SET cnt = 1 I'm using MySQL.
  19. aalnaif

    Declaring variables

    I know this is really simple, but I've been suck on this for 2 hrs and I can't figure it out. I'm getting a syntax error when declaring a variable within an UPDATE statement. Here's how I'm declaring it: DECLARE cnt int SET cnt = 1 I'm using MySQL.
  20. aalnaif

    Left joining more than 3 tables

    Is there an easy way to join more than 3 tables in MySQL without resorting to the nested Left join? I'm trying to join ~ 20 tables and the syntax I'm thinking about using is: SELECT a.Col1, b.Col2, c.Col3, d.Col4 FROM Tbl1 AS a LEFT JOIN Tbl2 AS b ON a.Col1 = b.Col2 LEFT JOIN Tbl3 AS c ON...

Part and Inventory Search

Back
Top