Sponsored Content
Full Discussion: Complex MySQL Query(s)
Top Forums Web Development Complex MySQL Query(s) Post 302453641 by STOIE on Thursday 16th of September 2010 01:28:41 AM
Old 09-16-2010
How about this:

Code:
select id, pid, name (SELECT max(saved) WHERE pid = 2.pid) AS max_date, (SELECT min(saved) WHERE pid = 2.pid) as min_date  
	from property property1
	where saved = (select max(saved) from property where pid = property1.pid)
	ORDER BY max_date;

Does this sound better...?

Bear in mind this is from an oracle guru...
Anyway, will check this out when I get home and have a db to play around with.

@ NEO
I am sure I could do that, but really wanted to package it neatly into a query.
Programming is being done in PERL

Last edited by Neo; 09-16-2010 at 02:32 AM.. Reason: cod tags
 

8 More Discussions You Might Find Interesting

1. Programming

Need help with complex SQL query (Sybase)

Hello, I have three tables. I need an SQL query (preferably Sybase) that will return all of the stringID values of table B where the following conditions exist: (1) B.intID = A.intID (2) B.intID != C.intID or (B.intID = C.intID and (C.v1 = 0 or C.v2... (2 Replies)
Discussion started by: chatieremerrill
2 Replies

2. Programming

How to query one to many mysql

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)
Discussion started by: pinkgladiator
0 Replies

3. Web Development

mysql query help

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)
Discussion started by: mogabr
6 Replies

4. Shell Programming and Scripting

Complex query

A file whose location i am not aware of contains the below text <url>jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(FAILOVER=on)(ADDRESS=(PROTOCOL=TCP) (HOST=ngm2sn1p2-vip.mybank.net)(PORT=4001))(ADDRESS=(PROTOCOL=TCP)(HOST=ngm2sn2p2-vip.mybank.net)... (1 Reply)
Discussion started by: mohtashims
1 Replies

5. Programming

mysql query help

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)
Discussion started by: mogabr
1 Replies

6. Shell Programming and Scripting

Complex string search query.

Hi, I wish to find the latest occurance of the below string in my log file. Once found, I need to search the below string after the above string and display this Request 331489 has passed or Request 331489 has failed I would like my query to be platform... (11 Replies)
Discussion started by: mohtashims
11 Replies

7. Shell Programming and Scripting

Complex Query regarding folder size

Hi, I provide the path to a folder. I would like so drill in each folder inside the folder i gave and show me the size in human readable form du -sh <folder-name> of the top 8 folders with maximum sizes. For example: Path of the folder: "/opt/app/myapp" has these directories. ls... (2 Replies)
Discussion started by: mohtashims
2 Replies

8. Programming

Need help in mysql query

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)
Discussion started by: venkitesh
2 Replies
PIDFILE(3)						   BSD Library Functions Manual 						PIDFILE(3)

NAME
pidfile -- write a daemon pid file LIBRARY
System Utilities Library (libutil, -lutil) SYNOPSIS
#include <util.h> int pidfile(const char *path); DESCRIPTION
pidfile() creates a file containing the process ID of the caller program. The pid file can be used as a quick reference if the process needs to be sent a signal. When the program exits, the pid file is removed automatically, unless the program receives a fatal signal. If path is NULL or a plain basename (a name containing no directory components), the pid file is created in the /var/run directory. The file name has the form /var/run/basename.pid. The basename part is either the value of path if it was not NULL, or the program name as returned by getprogname(3) otherwise. If path is an absolute or relative path (i.e. it contains the '/' character), the pid file is created in the provided location. Note that only the first invocation of pidfile() causes a pid file to be written; subsequent invocations have no effect unless a new path is supplied. If called with a new path, pidfile() will remove the old pid file and write the new one. RETURN VALUES
pidfile() returns 0 on success and -1 on failure. SEE ALSO
atexit(3) HISTORY
The pidfile() function call appeared in NetBSD 1.5. Support for creating pid files in any arbitrary path was added in NetBSD 6.0. BUGS
pidfile() uses atexit(3) to ensure the pid file is unlinked at program exit. However, programs that use the _exit(2) function (for example, in signal handlers) will not trigger this behaviour. BSD
March 23, 2011 BSD
All times are GMT -4. The time now is 08:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy