Just a little help if possible
I have a table with date data, I want to select dates that fall between today and 1 month ago, here's my query
But this return nothing, also tried swapping the dates
This
returns the columns without an issue, what am I missing?
Also if I use:
it listed the entire table regardless of the stdate
Last edited by barrydocks; 11-25-2014 at 09:17 AM..
Reason: extra stuff
A nested query must have an alias, so I added 'X' as the alias in your code:
As regards your earlier question, in MySQL and other databases too, there is a difference between single quote (') and backquote (`). I think you meant to use the latter, which is what Ditto was getting at.
A nested query must have an alias, so I added 'X' as the alias in your code:
As regards your earlier question, in MySQL and other databases too, there is a difference between single quote (') and backquote (`). I think you meant to use the latter, which is what Ditto was getting at.
I'm an Oracle guy, not very familiar with MYSQL .. I was thinking his issue was the fact that:
where column = 'today'
is not the same as:
where column = today
if today is some internal function, then you probably shouldn't use single quotes ... if MYSQL uses back quotes ` .. then yeah, sure but I was making an assumption MYSQL treats single or double quotes as strings.
which would be like trying to match:
where Nov 25, 2014 = "today" ..
as opposed to:
where Nov 25, 2014 = Nov 25, 2014
(ie where date_col = today ) ??
Hi All,
i have a table in mysql with the following data
Table name Test
Assettype Serial_No Status location
Mouse 123456 In Stock chennai
Mouse 98765 Allocated chennai
Keyboard ... (2 Replies)
Hi,
I've written a script to search for an Oracle ORA- error on a log file, print that line and the .trc file associated with it as well as the dateline of when I assumed the error occured. In most it is the first dateline previous to the error.
Unfortunately, this is not a fool proof script.... (2 Replies)
Hello
i have created mysql query to compare to values and get difference in percentage
as following:
SELECT file_name, 100 - ((100 * (SELECT file_count FROM xipi_files z WHERE x.file_group = z.file_group AND x.file_name = z.file_name AND z.insert_date = CURDATE( ) - INTERVAL 1 DAY)) /... (1 Reply)
Hi,
I want to run below query on shellscript but having one problm.
ADV=$( mysql -h "$IP_ADDR" -u "$USER_NAME" "$TABLE_NAME" -BNe" SELECT ADV FROM indata where inid='$INSTRUID' and Date='$latest Date';" )
here Date column contans different below dates
2011-12-01... (11 Replies)
hello all
i have 2 columns every column in the following format
column1
2011-04-01 11:39:54
column2
2019-02-03 00:00:00
i want get difference between above data as following
2 days 11:39
how to do so ?
i tried many functions but nothing works
please advice what is the query... (6 Replies)
Hi there,
I have a hierarchical database that include 4 tables. Table A is the parent of B, B is Parent of C, C is parent of D. If I want to query everything in D that is associated with A.name, how do I do that? Thanks!
YanYan (0 Replies)