Welcome to AC Web.
Results 1 to 3 of 3
  1. #1

    Select statement sql - help


    REGISTER! (FREE)
    Registered members see less ads
    and also gain access to other great features.
    Hello,

    Does anyone know how to return multiple results in one results table rather than separate tabs?

    I need to export data from 416 records however when using the following query:

    Code:
    SELECT * FROM creature WHERE id='46647';
    SELECT * FROM creature WHERE id='501475';
    SELECT * FROM creature WHERE id='90201';
    SELECT * FROM creature WHERE id='90015';
    SELECT * FROM creature WHERE id='501478';
    It returns in 5 separate tabs, I need it merged into one. Is this possible?




    Would appreciate any help.

    *SOLVED*

    I had to put UNION ALL at the end of each line, for example.

    Code:
    SELECT * FROM creature WHERE id='46647' UNION ALL
    SELECT * FROM creature WHERE id='501475' UNION ALL
    SELECT * FROM creature WHERE id='90201' UNION ALL
    SELECT * FROM creature WHERE id='90015' UNION ALL
    SELECT * FROM creature WHERE id='501478';
    Last edited by curtzxx; 03-25-2020 at 02:16 AM. Reason: Solved.

  2. #2


    Join Date
    Jun 2012
    Location
    http://undamed-wow.com/
    Posts
    528
    For future reference you can use this
    Code:
    SELECT * FROM creature WHERE id IN (46647, 90201, 90015, 501475, 501478);

  3. #3

    REGISTER! (FREE)
    Registered members see less ads
    and also gain access to other great features.
    why!?

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •