Need SQL help to pull the accounts
I have a table with account and publications(300 to 305). Each account is associated with more 1 to 5 publications. Now i want accounts that are associated with greater than or equal to 2 publications. I need your help with the SQL. Thanks.
Maybe
select account
from accounts
group by account
having count(publication) > 1Regards
Etbin
Edited by: Etbin on 1.11.2011 21:59
or
select a.account
from accounts a,publications p
where a.account = p.account
group by a.account
having count(p.publication) > 1
Similar Messages
-
need some help to unlock the Ipad. Cannot contact the previous owner he is in the shelter and I do not know were. After I restored the Ipad is asking that the previous owner has to remove it from his account
Nobody on these boards or at Apple will unlock that device for you. Sorry.
(117810) -
I forgot my Apple ID password. and I tried to rest it but I don't get a reset email to change the password. What do I need to do to return the account. (I need the specified account because I bought apps with it.)
The Best Alternatives for Security Questions and Rescue Mail
a. Send Apple an email request at: Apple - Support - iTunes Store - Contact Us.
b. Call Apple Support in your country: Customer Service: Contact Apple support.
c. Rescue email address and how to reset Apple ID security questions. -
Please help me with the accounting records of iTunes. At step in placing credit card details are asked to contact iTunes Support
Brenda, the easiest way to contact the support team is thru the iTunes Customer Service website:
http://www.apple.com/support/itunes/contact/ -
need some help here on the proper setting for quicktime exporting that won't denegrate my footage from handycam canon fs200
What are the existing settings iMovie?
Al -
Hello, I need some help on renaming the title on mi web pages!
Hello, I need some help on renaming the title on mi web pages! appear to be locked by the template and I would like to know if is posible rename each page with diferent title? Thanks,
@ Gary: No, there is no need to specify an editable region in the page title.
If you make a template from a page, by saving it as a template (using "save as template"), the page title is automatically made editable.
@ Jesus: if you look into the code of your template or of any childpage, it should read like this:
<!-- TemplateBeginEditable name="doctitle" -->
<title>Mi PageTitle</title>
<!-- TemplateEndEditable -->
meaning that the page title is indeed editable.
If it does not look like this, something went wrong.
Maybe do a little test, save your page as a template and see if the code reads as above.
It is important that you keep your templates in the Templates folder in your root folder
Do not move the folder or change its name, otherwise it will not work. -
Need sql querry to retive the data from sysdate to last365 days data.
Hi ,
I need sql querry to retrive the data based on this condition:date Between Previous 365 days and current day.
emp sal date
1 200 03-mar-2011
1 200 03-mar-2008
1 200 06-mar-2012
1 200 03-mar-2003
1 200 03-mar-2004
1 200 03-mar-2005
and so on.......lot of records....
i need the all the employee data from currentdate(sysdate) to previous 365 days data...
Edited by: 937506 on Jun 7, 2012 4:26 AM937506 wrote:
Hi ,
I need sql querry to retrive the data based on this condition:date Between Previous 365 days and current day.
emp sal date
1 200 03-mar-2011
1 200 03-mar-2008
1 200 06-mar-2012
1 200 03-mar-2003
1 200 03-mar-2004
1 200 03-mar-2005
and so on.......lot of records....
i need the all the employee data from currentdate(sysdate) to previous 365 days data...
Edited by: 937506 on Jun 7, 2012 4:26 AMJust you can do this
<date_column> between sysdate-365 and sysdateAnd DATE is a reserved word and you cannot use it as a column name. -
Need SQL help in select data from 2 table..
hi,
i need some help here as i am new to sql statement
I have 3 tables.
Table1 :- TeamID, Team_Name, Team_Logo
Table2:- TeamID, PlayerID
Table3:- PlayerID, Player_Name
How do i do a single select statement that select all information from table1 and the count of playerID from table2?
My MS access table has relationships.
One team can have many players. So how do it get the numbers of player in my team?
Thanks.Thanks.
but may i know why i have to max (a.team_name)???Actually there is no need of max() here, but it must be an aggregate function to use in this context. There is no harm in using it like this. This is a work around, I didn't get enough time to work on it.
But as long as it gives correct result, don't worry about it.
btw, how do i assign duke $$ to u?
i am new to this forum.You can read at http://forum.java.sun.com/rewardFaq.jsp#assign
Have a nice weekend.
Sudha -
Hi , I need some help !
I have X table and some 1000 records .
Some example :Each record has ID , firstname ,lastname ,Monday,tuesday,Wed,Thurs,Fri,Sat,Sunday .
Now , Employer who works for Monday to Friday - has values in the record and Saturday ,Sunday - null values (due to off)
Now, i need sql query logic . For all the employers , Sat and Sunday values should be changed by Monday values .
Please,its kind of urgent .Hopefully my question clear .
Thanks :)For this type of question, it is always a good idea to post:
1) CREATE TABLE statements for your table(s).
2) INSERT statements with sample data.
3) The desired result given the sample.
4) A short description of the business rules which explains why want that particular result.
5) Which version of SQL Server you are using.
This helps to clarify ambuiguities in your post and makes it simple to copy and paste into a query window to develop a tested query.
Since you said that this is urgent, I really recommend that you compose test data that covers all aspect of the problem, so that you can get a solution quickly.
Erland Sommarskog, SQL Server MVP, [email protected] -
Need Sql Query that Suppress the repeating rows.
Hi Sir,
I have below data set.
DeptID Sum(SAL) Avg(Sal)
10 1300 1300
10 2450 1300
10 5000 1300
20 800 800
20 1100 800
20 2975 800
20 3000 800
30 800 800
30 1100 800
30 2975 800
40 3000 800
40 4000 900
I Need SQL query that can remove the duplicate or suppress.Just like below data set.
Output:
DeptID Sum(SAL) Avg(Sal)
10 1300 1300
2450 1300
5000 1300
20 800 800
1100 800
2975 800
3000 800
800 800
30 1100 800
2975 800
40 3000 800
4000 900
Could you please help me on this..Your requiremnt is more of a reporting request which should not be handled in SQL. For example in SQL Plus you can use the BREAK command
SQL> break on deptno
SQL> select deptno, ename from emp order by deptno;
DEPTNO ENAME
10 KING
CLARK
20 JONES
SCOTT
SMITH
ADAMS
30 TURNER
MARTIN
WARD
ALLEN
BLAKE
11 rows selected.
SQL>
But if you still wish to do it in SQL you can use ROW_NUMBER analytic function and achieve it like this
select decode(rno, 1, deptno) deptno
, ename
from (
select row_number() over(partition by deptno order by ename) rno
, deptno
, ename
from emp -
Need Functional help to get the MIRO Number from deferent seanario.
Hai All
I developed One report to get the Accounting document number by using PO number.
CASE 1. In My Case One single PO is having Multiple GRN each GRN amy Have Single MIRO number or Multiple MIRO Number.
I ll get this By Using PO with Line Item Number this is not an Issue.
CASE2. In One PO Multiple GRN is there and One Single ITEM is having Two GRN Number, Each GRN is having single Accounting Number (MIRO) number.
Tell me how can i do this
actually I am using RSEG and BKPF table to get accounting Number.
Which table i have to use to get the Accounting number by using GRN number.
Please Help me.
Jagadish.iText. PdfReader.getNumberOfPages()
-
Need SQL query to get the result.
Region
Month
Trx Type
Resolution Summary
AMERICAS
May-13
Adjustments
Correct
EMEA
May-13
Adjustments
Incorrect
AMERICAS
May-13
Credit Memo
Incorrect
EMEA
May-13
Invoice
Correct
AMERICAS
May-13
Credit Memo
Correct
OFD
May-13
Adjustments
Correct
AMERICAS
May-13
Invoice
Incorrect
LAD
May-13
Adjustments
Correct
LAD
May-13
Adjustments
Correct
OFD
May-13
Adjustments
Correct
Above is my Table and find below the required result.Similarly for other regions as well. Can anyone help me with the SQL Query?
Region
Resolution Summary
Adjustment
Credit Memo
Invoice
Grand Total
AMERICAS
Correct
1
1
2
Incorrect
0
1
1
2Like this?
SQL> select * from transaction_audit;
REGION MTH TRX_TYPE RESOLUTIO
AMERICAS may-13 ADJUSTMENTS CORRECT
EMEA may-13 ADJUSTMENTS INCORRECT
AMERICAS may-13 CREDIT MEMO INCORRECT
EMEA may-13 INVOICE CORRECT
AMERICAS may-13 CREDIT MEMO CORRECT
OFD may-13 ADJUSTMENTS CORRECT
AMERICAS may-13 INVOICE INCORRECT
LAD may-13 ADJUSTMENTS CORRECT
LAD may-13 ADJUSTMENTS CORRECT
OFD may-13 ADJUSTMENTS CORRECT
10 rows selected.
SQL> select region
2 , resolution_summary
3 , count(decode(trx_type, 'ADJUSTMENTS', trx_type)) adjustments
4 , count(decode(trx_type, 'CREDIT MEMO', trx_type)) credit_memo
5 , count(decode(trx_type, 'INVOICE' , trx_type)) invoice
6 from transaction_audit
7 group
8 by region
9 , resolution_summary
10 order
11 by region
12 , resolution_summary
13 /
REGION RESOLUTIO ADJUSTMENTS CREDIT_MEMO INVOICE
AMERICAS CORRECT 1 1 0
AMERICAS INCORRECT 0 1 1
EMEA CORRECT 0 0 1
EMEA INCORRECT 1 0 0
LAD CORRECT 2 0 0
OFD CORRECT 2 0 0
6 rows selected.
SQL> -
I need heed help for Handle the JButton
hi, guys
I am writing a small program
It has name and number field.
It also has the first, privious, next , last and add buttons.
i want to load the myData.txt file to the name and number field.
and I want to make the buttons handle the events.
and when the application is closed, it will save the data into the files.
I can assign the the add button to save the files, and save the data when it is closed, but I can not make it save more than one record.
i need ur help to the rest of the buttons, and load the file back to the field.
andy suggestion would be great!
Thank !
here codes
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
import javax.swing.event.*;
import java.io.*;
public class buttonAction extends JFrame
private JLabel nameL;
private JLabel numberL;
private JTextField name;
private JTextField number;
private JButton first;
private JButton prev;
private JTextField current;
private JButton next;
private JButton last;
private JButton add;
private JButton exit;
private final int winw = 410;
private final int winh = 200;
private buttonAction()
super("Wage Calculate");
setSize(winw, winh);
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
addWindowListener(new Closing());
setLayout (new BorderLayout());
loadData();
buildPanel();
buildButtomButtons();
setVisible(true);
private void buildPanel()
nameL = new JLabel("Name:");
numberL = new JLabel("Number:");
name = new JTextField(10);
number = new JTextField(5);
JPanel panel =new JPanel();
panel.setLayout(new GridLayout(2,1));
panel.add(nameL);
panel.add(name);
panel.add(numberL);
panel.add(number);
add(panel, BorderLayout.NORTH);
private void buildButtomButtons()
first = new JButton("First");
prev = new JButton("Prev");
current = new JTextField(5);
current.setEditable(false);
next = new JButton("Next");
last = new JButton("Last");
add = new JButton("Add");
exit = new JButton("Exit");
JPanel button = new JPanel();
first.addActionListener(new ButtonListener());
prev.addActionListener(new ButtonListener());
current.addActionListener(new ButtonListener());
next.addActionListener(new ButtonListener());
last.addActionListener(new ButtonListener());
add.addActionListener(new ButtonListener());
button.add(first);
button.add(prev);
button.add(current);
button.add(next);
button.add(last);
button.add(add);
add(button, BorderLayout.SOUTH);
// save the data into the file when the application is close
public class Closing extends WindowAdapter
public void windowClosing(WindowEvent e)
try {
PrintWriter out = new PrintWriter (new FileWriter("myData.txt"));
out.println (name.getText());
out.println(number.getText());
out.close();
catch (IOException ee) {
// Happens if the file cannot be written to for any reason
JOptionPane.showMessageDialog(null, "Could not save the file " + ee.getMessage());
System.exit(0);
private void loadData()
try {
BufferedReader fileReader = new BufferedReader(new FileReader(new File("myData.txt")));
String lineRead = fileReader.readLine();
// I need help how to load the data
catch (FileNotFoundException e)
e.printStackTrace();
catch (IOException e) {
e.printStackTrace();
//handle the first, previous, next, last, add buttons
private class ButtonListener implements ActionListener
public void actionPerformed(ActionEvent e)
Object button = e.getSource();
if (button == add)
try
PrintWriter out = new PrintWriter (new FileWriter("myData.txt"));
out.println (name.getText());
out.println(number.getText());
out.close();
catch (IOException ee)
// Happens if the file cannot be written to for any reason
JOptionPane.showMessageDialog(null, "Could not save the file " + ee.getMessage());
//I need help for the first, privious and last buttons
public static void main(String[] args)
buttonAction pr = new buttonAction();
}are you trying to load a multi line textfile int a JTextField? If you try to load this in a while loop as you read the file, it will zoom through the file, and you will probably only see the last line of the file (or nothing if the last line is blank) in the jtextfield. Consider using a JTextArea or some other component that can hold multiple lines. Also your file reading method calls look wrong to me. You appear to read a line, then continually check if that one read line is null, and if not do a while loop, that looks to loop forever. Look at the java I/O examples for how to do this right.
Good luck -
Need a help to write the query
Hi,
I need a small help to write the query.
I have a table contains couponid,coupon,createdate,expirationdate,assigndate from couponday table
i want to write the query to select the coupon whose Expiry date in the table is NOT within 30 days.
Thanks in advanceHi,
user586 wrote:
i want to write the query to select the coupon whose Expiry date in the table is NOT within 30 days.If you mean expirationdate (datatype: DATE) is not within 30 days (past or future) of run time, then:
SELECT coupon -- or whatever columns you want
FROM table_x
WHERE expirationdate NOT BETWEEN SYSDATE - 30
AND SYSDATE + 30
; -
Hello I need your help with installing the flash drive into my laptop
Hi
I am Rachel Friedman asking for your help with installing the flashdrive player into my laptop.
Thanks
RachelTo give you any useful advice, I'm going to need to know more about your computer and browser:
https://forums.adobe.com/message/5249945#5249945
Maybe you are looking for
-
Can't add certain MP3s to Itunes
I have about 150 files on my PC that won't load / play through Itunes. They play fine through other players. They have played fine in the past - but no more. It appears to be completely random. 3100 other songs work fine. Any suggestions?
-
9.4.2 Removed Basic Functionality!!
After upgrading Acrobat via a consistent message saying upgrade now or the world will collapse and btw, this upgrade addresses a serious security threat, my Acrobat Pro will no longer create PDF files either from within an Office App, from within Acr
-
Class not found in signed applet
Hello I am using a signed applet and am getting a class not found exception this works fine when i run it in the IDE but get the exception when i try to load the applet from the web browser in the application. java.lang.ClassNotFoundException: MyAppl
-
Can't set date and time automatically thru Airport Extreme
We have an Airport Extreme that serves as the router for our home network. No computer using the Airport (wirelessly or via ethernet) can set it's date and time automatically. If I bypass the Airport and hook a computer directly to the ISP's modem vi
-
Repeated short duration calls 1-5 seconds
Hello, new to this forum. Thanks in advance for any help. On receiving my latest itemised bill, I noticed that I have repeated very short duration calls to mobiles of between 1 and 5 secs (107 in all). On one evening I have 31 calls to the same numb