To display all records of table?

viki

To display all records of table1 except A containing 2 as well as B containing 5

Table1
------

A          B
-         
8          5

2          9

null       4

2          5

select * from table1 where a not in 2 and b not in 5;

It doesn't work ,It will display like 0 rows selected

Joe Taras

Try this:

SELECT * FROM Table1
WHERE (a is null or a != 2) and (b is null or b != 5)

EDIT

Sql Fiddle, many thanks to Nagaraj S

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to display all records from a table with RedBeanPHP?

From Dev

Count all records in a table

From Dev

Display all table A records which are not in table B using mysql joins concept

From Dev

Delete All Azure Table Records

From Dev

Foreach loop to display all records with same id

From Dev

SQL: Display all the records related to common id

From Dev

SQL How to display all records in group by

From Dev

SQL: Display all the records related to common id

From Dev

display records from a table using if statement

From Dev

count records from sql table and display it on textbox

From Dev

Display mySQL records as HTML table columns

From Dev

Display records in table with fixed number of columns

From Dev

GeoJSON - Display all features in a table

From Dev

Hibernate joining two table and fetch all records?

From Java

Delete all records in a table of MYSQL in phpMyAdmin

From Dev

Not getting all records from Table A in left join

From Dev

Get all records from table - EclipseLink

From Dev

Laravel Eloquent firstOrFail returns all records in table

From Dev

Get all records if table valued parameter is null

From Dev

Get all records from azure table storage

From Dev

Get all records in table without field

From Dev

Getting all records from database to Vaadin Table

From Dev

Getting SQLite to delete all records in a table

From Dev

How to remove all records of the table in Hybris?

From Dev

Get all records from another table with pivot

From Dev

Laravel Eloquent firstOrFail returns all records in table

From Dev

Disable button if textboxes are empty for all the records in a table

From Dev

Delete all records from table that starts with <

From Dev

Retriving all records from left table and matching records from right

Related Related

  1. 1

    How to display all records from a table with RedBeanPHP?

  2. 2

    Count all records in a table

  3. 3

    Display all table A records which are not in table B using mysql joins concept

  4. 4

    Delete All Azure Table Records

  5. 5

    Foreach loop to display all records with same id

  6. 6

    SQL: Display all the records related to common id

  7. 7

    SQL How to display all records in group by

  8. 8

    SQL: Display all the records related to common id

  9. 9

    display records from a table using if statement

  10. 10

    count records from sql table and display it on textbox

  11. 11

    Display mySQL records as HTML table columns

  12. 12

    Display records in table with fixed number of columns

  13. 13

    GeoJSON - Display all features in a table

  14. 14

    Hibernate joining two table and fetch all records?

  15. 15

    Delete all records in a table of MYSQL in phpMyAdmin

  16. 16

    Not getting all records from Table A in left join

  17. 17

    Get all records from table - EclipseLink

  18. 18

    Laravel Eloquent firstOrFail returns all records in table

  19. 19

    Get all records if table valued parameter is null

  20. 20

    Get all records from azure table storage

  21. 21

    Get all records in table without field

  22. 22

    Getting all records from database to Vaadin Table

  23. 23

    Getting SQLite to delete all records in a table

  24. 24

    How to remove all records of the table in Hybris?

  25. 25

    Get all records from another table with pivot

  26. 26

    Laravel Eloquent firstOrFail returns all records in table

  27. 27

    Disable button if textboxes are empty for all the records in a table

  28. 28

    Delete all records from table that starts with <

  29. 29

    Retriving all records from left table and matching records from right

HotTag

Archive